working commit

This commit is contained in:
2026-02-07 11:24:30 +02:00
parent f76881a765
commit 90905ace89
6 changed files with 102 additions and 21 deletions
+8 -1
View File
@@ -10,6 +10,8 @@
package handler
import (
"net/http"
"mstore/app/operator"
"mstore/app/router"
)
@@ -19,7 +21,12 @@ func (hand *Handler) GetVersion(rctx *router.Context) {
params := &operator.GetVersionParams{}
hand.DumpHeaders("GetVersion", rctx)
authorization := rctx.GetHeader("Authorization")
if authorization == "" {
rctx.SetHeader("WWW-Authenticate", `Basic realm="mstore"`)
rctx.SetStatus(http.StatusUnauthorized)
return
}
ctx := rctx.GetContext()
_, code, err := hand.oper.GetVersion(ctx, params)
if err != nil {