Skip to content

Commit df7c47b

Browse files
committed
proxy: delete req cookie if empty
1 parent 97b15cb commit df7c47b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

internal/proxy/oauthproxy.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,14 @@ func deleteSSOCookieHeader(req *http.Request, cookieName string) {
112112
headers = append(headers, cookie.String())
113113
}
114114
}
115+
116+
if len(headers) == 0 {
117+
// there are no cookies other then session cookie so we delete the header entirely
118+
req.Header.Del("Cookie")
119+
return
120+
}
121+
122+
// if there are other headers to keep, we reset them minues the session cookie
115123
req.Header.Set("Cookie", strings.Join(headers, ";"))
116124
}
117125

0 commit comments

Comments
 (0)