mirror of
https://github.com/woodchen-ink/proxy-go.git
synced 2025-07-18 08:31:55 +08:00
refactor(internal/handler): simplify HTTP client configuration and remove strict CSP header
This commit is contained in:
parent
c71698e5ad
commit
1e65ccad58
@ -143,11 +143,7 @@ func (h *ProxyHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
// 发送代理请求
|
||||
client := &http.Client{
|
||||
Transport: &http.Transport{
|
||||
DisableCompression: true, // 禁用自动压缩
|
||||
},
|
||||
}
|
||||
client := &http.Client{}
|
||||
resp, err := client.Do(proxyReq)
|
||||
|
||||
if err != nil {
|
||||
@ -160,6 +156,9 @@ func (h *ProxyHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
copyHeader(w.Header(), resp.Header)
|
||||
|
||||
// 删除严格的 CSP
|
||||
w.Header().Del("Content-Security-Policy")
|
||||
|
||||
// 设置响应状态码
|
||||
w.WriteHeader(resp.StatusCode)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user