Add mcp bearer header
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
@@ -43,6 +43,7 @@ func RequireAPIKeyHandler(
|
|||||||
apiKey := authn.APIKeyFromContext(ctx)
|
apiKey := authn.APIKeyFromContext(ctx)
|
||||||
identity := authn.IdentityFromContext(ctx)
|
identity := authn.IdentityFromContext(ctx)
|
||||||
if identity == nil {
|
if identity == nil {
|
||||||
|
w.Header().Set("WWW-Authenticate", "Bearer")
|
||||||
httpserver.RenderError(w, http.StatusUnauthorized, errors.New("authentication required"))
|
httpserver.RenderError(w, http.StatusUnauthorized, errors.New("authentication required"))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user