Skip to content

Commit

Permalink
Merge pull request #1110 from apernet/fix-http-connect-header
Browse files Browse the repository at this point in the history
fix(client/http): ffmpeg not works with proxy
  • Loading branch information
tobyxdd authored May 30, 2024
2 parents 492145c + 23b7968 commit 52c8f82
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/internal/http/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,11 @@ func sendSimpleResponse(conn net.Conn, req *http.Request, statusCode int) error
ProtoMinor: req.ProtoMinor,
Header: http.Header{},
}
// Remove the "Content-Length: 0" header, some clients (e.g. ffmpeg) may not like it.
resp.ContentLength = -1
// Also, prevent the "Connection: close" header.
resp.Close = false
resp.Uncompressed = true
return resp.Write(conn)
}

Expand Down

0 comments on commit 52c8f82

Please sign in to comment.