fix http proxy response

This commit is contained in:
ginuerzh
2024-06-25 22:09:00 +08:00
parent b99292bed8
commit 74dc03bd66
2 changed files with 16 additions and 4 deletions

View File

@ -161,14 +161,19 @@ func (h *httpHandler) handleRequest(ctx context.Context, conn net.Conn, req *htt
log.Debugf("%s >> %s", conn.RemoteAddr(), addr)
resp := &http.Response{
ProtoMajor: 1,
ProtoMinor: 1,
Header: h.md.header,
ProtoMajor: 1,
ProtoMinor: 1,
Header: h.md.header,
ContentLength: -1,
}
if resp.Header == nil {
resp.Header = http.Header{}
}
if resp.Header.Get("Proxy-Agent") == "" {
resp.Header.Set("Proxy-Agent", h.md.proxyAgent)
}
clientID, ok := h.authenticate(ctx, conn, req, resp, log)
if !ok {
return nil