Skip to content

Commit 340be42

Browse files
committed
[minor] Dont use .bind()
1 parent daf9231 commit 340be42

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/node-http-proxy.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,11 @@ exports.createServer = function () {
103103
proxy = new HttpProxy(options);
104104
handler = callback
105105
? function (req, res) { callback(req, res, proxy) }
106-
: proxy.proxyRequest;
106+
: function (req, res) { proxy.proxyRequest(req, res) };
107107

108108
server = options.https
109-
? https.createServer(options.https, handler.bind(proxy))
110-
: http.createServer(handler.bind(proxy));
109+
? https.createServer(options.https, handler)
110+
: http.createServer(handler);
111111

112112
//server.on('close', function () {
113113
// proxy.close();

0 commit comments

Comments
 (0)