8000 [minor] Use trinary operator · netconstructor/node-http-proxy@cf75f78 · GitHub
[go: up one dir, main page]

Skip to content

Commit cf75f78

Browse files
committed
[minor] Use trinary operator
1 parent 4acb00b commit cf75f78

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/http-proxy/http-proxy.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,9 @@ HttpProxy.prototype.proxyRequest = function (req, res, buffer) {
237237
// Process the `reverseProxy` `response` when it's received.
238238
//
239239
if (response.headers.connection) {
240-
if (req.headers.connection) { response.headers.connection = req.headers.connection }
241-
else { response.headers.connection = 'close' }
240+
response.headers.connection = req.headers.connection
241+
? req.headers.connection
242+
: 'close';
242243
}
243244

244245
// Remove `Transfer-Encoding` header if client's protocol is HTTP/1.0

0 commit comments

Comments
 (0)
0