mirror of
https://github.com/WJQSERVER-STUDIO/ghproxy.git
synced 2026-02-03 00:01:10 +08:00
17 lines
379 B
Go
17 lines
379 B
Go
package proxy
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/cloudwego/hertz/pkg/app"
|
|
)
|
|
|
|
func setRequestHeaders(c *app.RequestContext, req *http.Request) {
|
|
c.Request.Header.VisitAll(func(key, value []byte) {
|
|
headerKey := string(key)
|
|
headerValue := string(value)
|
|
if _, shouldRemove := reqHeadersToRemove[headerKey]; !shouldRemove {
|
|
req.Header.Set(headerKey, headerValue)
|
|
}
|
|
})
|
|
}
|