Permalink
Browse files

Try translating 403s to 404s to appease Visual Studio

Visual Studio seems to stop requesting symbols from a server once it
gets a 403.
  • Loading branch information...
1 parent 266d95b commit d84eb06e6b09b7e6afdd05c235b7aa576f4e8187 @aroben committed Apr 16, 2012
Showing with 10 additions and 1 deletion.
  1. +10 −1 lowercaseme.js
View
@@ -3,7 +3,16 @@ var HTTP = require('http')
, URL = require('url')
;
-HTTPProxy.createServer(function(request, response, proxy) {
+HTTPProxy.createServer(function(request, response, next) {
+ var original = response.writeHead;
+ response.writeHead = function() {
+ var args = Array.prototype.slice.call(arguments);
+ if (args[0] == 403)
+ args[0] = 404;
+ original.apply(response, args);
+ };
+ next();
+}, function(request, response, proxy) {
var innerURL = request.url.substr(1);
var parsedURL = URL.parse(innerURL);
if (!parsedURL.hostname) {

0 comments on commit d84eb06

Please sign in to comment.