From a784fc96f8c89c6a9016b5633d40510c0c7b04ed Mon Sep 17 00:00:00 2001 From: Rob Wu Date: Thu, 29 Aug 2013 17:09:20 +0200 Subject: [PATCH] Simplified demo.html; show proxyError on error --- demo.html | 51 +++++++++++++++++--------------------------- lib/cors-anywhere.js | 4 ++-- 2 files changed, 21 insertions(+), 34 deletions(-) diff --git a/demo.html b/demo.html index 09e54f0..6307dcf 100644 --- a/demo.html +++ b/demo.html @@ -66,21 +66,19 @@ textarea { diff --git a/lib/cors-anywhere.js b/lib/cors-anywhere.js index a350ba7..3c8d730 100644 --- a/lib/cors-anywhere.js +++ b/lib/cors-anywhere.js @@ -336,8 +336,8 @@ exports.createServer = function createServer(options) { // When the server fails, just show a 404 instead of Internal server error server.proxy.on('proxyError', function(err, req, res) { - res.writeHead(404, {}); - res.end(); + res.writeHead(404, {'Access-Control-Allow-Origin': '*'}); + res.end('Not found because of proxy error: ' + err); }); return server;