Skip to content

Commit 7fd3e09

Browse files
committed
fix: improve proxy header handling and remove existing Authorization header
- Remove existing Authorization header before setting proxy headers - Properly iterate through proxy headers to add all values - Prevents header conflicts when proxying authenticated requests
1 parent 4b5e828 commit 7fd3e09

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

pkg/proxy/main.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,12 @@ func (p *ProxyRouter) handleProxy(c *gin.Context) {
7272
return
7373
}
7474

75-
c.Request.Header = p.proxyHeaders
75+
c.Request.Header.Del("Authorization")
76+
for key, values := range p.proxyHeaders {
77+
for _, value := range values {
78+
c.Request.Header.Add(key, value)
79+
}
80+
}
7681

7782
p.proxy.ServeHTTP(c.Writer, c.Request)
7883
}

0 commit comments

Comments
 (0)