mirror of
https://github.com/harness/drone.git
synced 2025-05-05 15:32:56 +00:00
fix: [AH-1237]: Fixing spaces in www-authenticate header (#3721)
* [AH-1237]: Fixing spaces in www-authenticate header
This commit is contained in:
parent
0ba7be95fd
commit
d493a9bf87
@ -156,9 +156,9 @@ func getScope(r *http.Request) string {
|
||||
}
|
||||
|
||||
func returnUnauthorised(ctx context.Context, w http.ResponseWriter, url string, scope string) {
|
||||
header := fmt.Sprintf(`Bearer realm="%s", service="gitness-registry"`, url)
|
||||
header := fmt.Sprintf(`Bearer realm="%s",service="gitness-registry"`, url)
|
||||
if scope != "" {
|
||||
header = fmt.Sprintf(`%s, scope="%s"`, header, scope)
|
||||
header = fmt.Sprintf(`%s,scope="%s"`, header, scope)
|
||||
}
|
||||
w.Header().Set("WWW-Authenticate", header)
|
||||
render.Unauthorized(ctx, w)
|
||||
|
Loading…
x
Reference in New Issue
Block a user