~sircmpwn/core-go

88dff0eae2770b3cb09a58af2052bc3061661a7d — Simon Ser 3 months ago 942e19c
auth/middleware: set WWW-Authenticate header field

See RFC 6750 section 3.
1 files changed, 1 insertions(+), 0 deletions(-)

M auth/middleware.go
M auth/middleware.go => auth/middleware.go +1 -0
@@ 705,6 705,7 @@ func RequireMiddleware(conf ini.File, apiconf string) func(http.Handler) http.Ha

			auth := r.Header.Get("Authorization")
			if auth == "" {
				w.Header().Set("WWW-Authenticate", "Bearer")
				authError(w, `Authorization header is required. Expected 'Authorization: Bearer [token]'`, http.StatusUnauthorized)
				return
			}