misc fixes

This commit is contained in:
Mikaël Cluseau
2023-02-13 17:24:28 +01:00
parent bde41c9859
commit 4acdf88785
7 changed files with 40 additions and 50 deletions

View File

@ -24,7 +24,7 @@ func tokenAuth(req *restful.Request, resp *restful.Response, chain *restful.Filt
}
}
resp.WriteErrorString(401, "401: Not Authorized")
wsError(resp, ErrUnauthorized)
return
}
@ -38,7 +38,7 @@ func getToken(req *restful.Request) string {
}
if !strings.HasPrefix(token, bearerPrefix) {
return ""
return token
}
return token[len(bearerPrefix):]