From d2023b45e1eb67009d85e371255c38fb45db7166 Mon Sep 17 00:00:00 2001 From: Rob Wu Date: Thu, 29 Aug 2013 19:31:19 +0200 Subject: [PATCH] Fix POST -> GET conversion on redirect --- lib/cors-anywhere.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/cors-anywhere.js b/lib/cors-anywhere.js index 3c8d730..83cf9be 100644 --- a/lib/cors-anywhere.js +++ b/lib/cors-anywhere.js @@ -141,6 +141,8 @@ function onProxyResponse(req, res, response) { res.setHeader('X-CORS-Redirect-' + requestState.redirectCount_, statusCode + ' ' + locationHeader); req.method = 'GET'; + req.headers['content-length'] = '0'; + delete req.headers['content-type']; requestState.location = parseURL(locationHeader); // ### Dispose the current proxied request