mirror of
https://github.com/WJQSERVER-STUDIO/ghproxy.git
synced 2026-02-03 00:01:10 +08:00
25w30e
This commit is contained in:
parent
b955c915ff
commit
7a6544c6c9
12 changed files with 170 additions and 182 deletions
|
|
@ -6,15 +6,6 @@ import (
|
|||
"github.com/cloudwego/hertz/pkg/app"
|
||||
)
|
||||
|
||||
/*
|
||||
// 设置请求头
|
||||
func setRequestHeaders(c *app.RequestContext, req *http.Request) {
|
||||
c.Request.Header.VisitAll(func(key, value []byte) {
|
||||
req.Header.Set(string(key), string(value))
|
||||
})
|
||||
}
|
||||
*/
|
||||
|
||||
func setRequestHeaders(c *app.RequestContext, req *http.Request) {
|
||||
c.Request.Header.VisitAll(func(key, value []byte) {
|
||||
headerKey := string(key)
|
||||
|
|
@ -22,16 +13,5 @@ func setRequestHeaders(c *app.RequestContext, req *http.Request) {
|
|||
if _, shouldRemove := reqHeadersToRemove[headerKey]; !shouldRemove {
|
||||
req.Header.Set(headerKey, headerValue)
|
||||
}
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
/*
|
||||
// removeWSHeader removes the "Upgrade" and "Connection" headers from the given
|
||||
// Request, which are added by the client when it wants to upgrade the
|
||||
// connection to a WebSocket connection.
|
||||
func removeWSHeader(req *http.Request) {
|
||||
req.Header.Del("Upgrade")
|
||||
req.Header.Del("Connection")
|
||||
}
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue