From 19de080098ddeb995ff18d0c487b531ab5c91866 Mon Sep 17 00:00:00 2001 From: Rob Wu Date: Wed, 6 May 2015 20:03:56 +0200 Subject: [PATCH] Move inline jshint directive to .jshintrc --- .jshintrc | 7 +++++++ lib/cors-anywhere.js | 5 ++--- 2 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 .jshintrc diff --git a/.jshintrc b/.jshintrc new file mode 100644 index 0000000..9238949 --- /dev/null +++ b/.jshintrc @@ -0,0 +1,7 @@ +{ + "node": true, + "eqnull": true, + "undef": true, + "unused": "vars", + "mocha": true +} diff --git a/lib/cors-anywhere.js b/lib/cors-anywhere.js index e6ca148..0f00cd2 100644 --- a/lib/cors-anywhere.js +++ b/lib/cors-anywhere.js @@ -2,7 +2,6 @@ // Released under the MIT license 'use strict'; -/* jshint node:true, eqnull:true, sub:true, quotmark:single, unused:true */ var httpProxy = require('http-proxy'); var net = require('net'); @@ -117,7 +116,7 @@ function onProxyResponse(response, req, res) { } // Handle redirects if (statusCode === 301 || statusCode === 302 || statusCode === 303 || statusCode === 307 || statusCode === 308) { - var locationHeader = response.headers['location']; + var locationHeader = response.headers.location; if (locationHeader) { locationHeader = url.resolve(requestState.location.href, locationHeader); @@ -157,7 +156,7 @@ function onProxyResponse(response, req, res) { return; } } - response.headers['location'] = requestState.proxyBaseUrl + '/' + locationHeader; + response.headers.location = requestState.proxyBaseUrl + '/' + locationHeader; } }