Skip to content

Commit 1591b84

Browse files
committed
fix: simplify proxy header handling logic
Replace loop-based header addition with direct header assignment for improved performance and cleaner code.
1 parent f8cfb44 commit 1591b84

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

pkg/proxy/main.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,7 @@ func (p *ProxyRouter) handleProxy(c *gin.Context) {
8080
return
8181
}
8282

83-
// Add custom headers to the request
84-
for name, values := range p.proxyHeaders {
85-
for _, value := range values {
86-
c.Request.Header.Add(name, value)
87-
}
88-
}
83+
c.Request.Header = p.proxyHeaders
8984

9085
p.proxy.ServeHTTP(c.Writer, c.Request)
9186
}

0 commit comments

Comments
 (0)