diff options
Diffstat (limited to 'internal/testhelper')
-rw-r--r-- | internal/testhelper/testserver.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/internal/testhelper/testserver.go b/internal/testhelper/testserver.go index d8a2f6d47..486708749 100644 --- a/internal/testhelper/testserver.go +++ b/internal/testhelper/testserver.go @@ -789,7 +789,10 @@ func handleCheck(options GitlabTestServerOptions) func(w http.ResponseWriter, r return func(w http.ResponseWriter, r *http.Request) { u, p, ok := r.BasicAuth() if !ok || u != options.User || p != options.Password { - http.Error(w, "authorization failed", http.StatusUnauthorized) + w.WriteHeader(http.StatusUnauthorized) + json.NewEncoder(w).Encode(struct { + Message string `json:"message"` + }{Message: "authorization failed"}) return } |