added /v2 auth info
This commit is contained in:
@@ -10,7 +10,7 @@
|
|||||||
package handler
|
package handler
|
||||||
|
|
||||||
import (
|
import (
|
||||||
//"net/http"
|
"net/http"
|
||||||
|
|
||||||
"mstore/app/imageoper"
|
"mstore/app/imageoper"
|
||||||
"mstore/app/router"
|
"mstore/app/router"
|
||||||
@@ -21,14 +21,15 @@ func (hand *Handler) GetVersion(rctx *router.Context) {
|
|||||||
params := &imageoper.GetVersionParams{}
|
params := &imageoper.GetVersionParams{}
|
||||||
|
|
||||||
//hand.DumpHeaders("GetVersion", rctx)
|
//hand.DumpHeaders("GetVersion", rctx)
|
||||||
/*
|
|
||||||
authorization := rctx.GetHeader("Authorization")
|
authorization := rctx.GetHeader("Authorization")
|
||||||
if authorization == "" {
|
if authorization == "" {
|
||||||
rctx.SetHeader("WWW-Authenticate", `Basic realm="mstore"`)
|
rctx.SetHeader("WWW-Authenticate", `Basic realm="mstore"`)
|
||||||
rctx.SetStatus(http.StatusUnauthorized)
|
//rctx.SetStatus(http.StatusUnauthorized)
|
||||||
|
rctx.SetStatus(http.StatusOK)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
ctx := rctx.GetContext()
|
ctx := rctx.GetContext()
|
||||||
_, code, err := hand.imop.GetVersion(ctx, params)
|
_, code, err := hand.imop.GetVersion(ctx, params)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user