From 220f5fb795d2977c5a68ae59d7db65089efed50c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Leurent?= Date: Sat, 22 Oct 2016 17:18:51 +0200 Subject: [PATCH] Expose full callback names --- lib/http-proxy/passes/web-incoming.js | 8 ++++---- lib/http-proxy/passes/web-outgoing.js | 10 +++++----- lib/http-proxy/passes/ws-incoming.js | 6 +++--- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/http-proxy/passes/web-incoming.js b/lib/http-proxy/passes/web-incoming.js index 6ff6e07..df5dfb5 100644 --- a/lib/http-proxy/passes/web-incoming.js +++ b/lib/http-proxy/passes/web-incoming.js @@ -28,7 +28,7 @@ module.exports = { * @api private */ - deleteLength : function(req, res, options) { + deleteLength : function deleteLength(req, res, options) { if((req.method === 'DELETE' || req.method === 'OPTIONS') && !req.headers['content-length']) { req.headers['content-length'] = '0'; @@ -46,7 +46,7 @@ module.exports = { * @api private */ - timeout: function(req, res, options) { + timeout: function timeout(req, res, options) { if(options.timeout) { req.socket.setTimeout(options.timeout); } @@ -62,7 +62,7 @@ module.exports = { * @api private */ - XHeaders : function(req, res, options) { + XHeaders : function XHeaders(req, res, options) { if(!options.xfwd) return; var encrypted = req.isSpdy || common.hasEncryptedConnection(req); @@ -94,7 +94,7 @@ module.exports = { * @api private */ - stream : function(req, res, options, _, server, clb) { + stream : function stream(req, res, options, _, server, clb) { // And we begin! server.emit('start', req, res, options.target) diff --git a/lib/http-proxy/passes/web-outgoing.js b/lib/http-proxy/passes/web-outgoing.js index 69d383e..e00bf50 100644 --- a/lib/http-proxy/passes/web-outgoing.js +++ b/lib/http-proxy/passes/web-outgoing.js @@ -23,7 +23,7 @@ module.exports = { // <-- * * @api private */ - removeChunked : function (req, res, proxyRes) { + removeChunked : function removeChunked(req, res, proxyRes) { if (req.httpVersion === '1.0') { delete proxyRes.headers['transfer-encoding']; } @@ -39,7 +39,7 @@ module.exports = { // <-- * * @api private */ - setConnection: function(req, res, proxyRes) { + setConnection: function setConnection(req, res, proxyRes) { if (req.httpVersion === '1.0') { proxyRes.headers.connection = req.headers.connection || 'close'; } else if (req.httpVersion !== '2.0' && !proxyRes.headers.connection) { @@ -47,7 +47,7 @@ module.exports = { // <-- } }, - setRedirectHostRewrite: function(req, res, proxyRes, options) { + setRedirectHostRewrite: function setRedirectHostRewrite(req, res, proxyRes, options) { if ((options.hostRewrite || options.autoRewrite || options.protocolRewrite) && proxyRes.headers['location'] && redirectRegex.test(proxyRes.statusCode)) { @@ -82,7 +82,7 @@ module.exports = { // <-- * * @api private */ - writeHeaders : function(req, res, proxyRes, options) { + writeHeaders : function writeHeaders(req, res, proxyRes, options) { var rewriteCookieDomainConfig = options.cookieDomainRewrite; if (typeof rewriteCookieDomainConfig === 'string') { //also test for '' rewriteCookieDomainConfig = { '*': rewriteCookieDomainConfig }; @@ -107,7 +107,7 @@ module.exports = { // <-- * * @api private */ - writeStatusCode : function(req, res, proxyRes) { + writeStatusCode : function writeStatusCode(req, res, proxyRes) { // From Node.js docs: response.writeHead(statusCode[, statusMessage][, headers]) if(proxyRes.statusMessage) { res.writeHead(proxyRes.statusCode, proxyRes.statusMessage); diff --git a/lib/http-proxy/passes/ws-incoming.js b/lib/http-proxy/passes/ws-incoming.js index 1dfe1fa..cf3796c 100644 --- a/lib/http-proxy/passes/ws-incoming.js +++ b/lib/http-proxy/passes/ws-incoming.js @@ -27,7 +27,7 @@ module.exports = { * @api private */ - checkMethodAndHeader : function (req, socket) { + checkMethodAndHeader : function checkMethodAndHeader(req, socket) { if (req.method !== 'GET' || !req.headers.upgrade) { socket.destroy(); return true; @@ -49,7 +49,7 @@ module.exports = { * @api private */ - XHeaders : function(req, socket, options) { + XHeaders : function XHeaders(req, socket, options) { if(!options.xfwd) return; var values = { @@ -76,7 +76,7 @@ module.exports = { * * @api private */ - stream : function(req, socket, options, head, server, clb) { + stream : function stream(req, socket, options, head, server, clb) { common.setupSocket(socket); if (head && head.length) socket.unshift(head);