Skip to content

Commit

Permalink
refactor(handler/sso/proxy): correct variable name
Browse files Browse the repository at this point in the history
  • Loading branch information
tronghn committed Sep 11, 2024
1 parent a5d98c7 commit d6b57a6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/handler/handler_sso_proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,13 +199,13 @@ func (s *SSOProxy) Wildcard(w http.ResponseWriter, r *http.Request) {
// These headers are already set by the very same middlewares at the SSO server.
// This avoids duplicate response headers when using [httputil.ReverseProxy] which uses [http.Header.Add] instead of [http.Header.Set] when copying headers from the upstream response.
func removeMiddlewareHeaders(w http.ResponseWriter) {
cacheHeaders := []string{
headers := []string{
// added by [chi_middleware.NoCache]
"Expires", "Cache-Control", "Pragma", "X-Accel-Expires",
// added by [middleware.Cors]
"Vary",
}
for _, header := range cacheHeaders {
for _, header := range headers {
w.Header().Del(header)
}
}

0 comments on commit d6b57a6

Please sign in to comment.