mirror of
https://github.com/http-party/node-http-proxy.git
synced 2025-12-08 20:59:18 +00:00
[fix] refactor
This commit is contained in:
parent
adb6763194
commit
405cc454c8
@ -86,11 +86,10 @@ ProxyStream.prototype.start = function (req) {
|
||||
//
|
||||
// Process the `pReq` `pRes` when it's received.
|
||||
//
|
||||
if (req.httpVersion === '1.0') {
|
||||
pRes.headers.connection = req.headers.connection || 'close';
|
||||
} else if (!pRes.headers.connection) {
|
||||
pRes.headers.connection = req.headers.connection || 'keep-alive';
|
||||
}
|
||||
(req.httpVersion === '1.0' || !pRes.headers.connection)
|
||||
&& pRes.headers.connection = req.headers.connection
|
||||
|| (req.httpVersion === '1.0' ? 'close' : 'keep-alive');
|
||||
|
||||
|
||||
// Remove `Transfer-Encoding` header if client's protocol is HTTP/1.0
|
||||
// or if this is a DELETE request with no content-length header.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user