We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 484cca2 commit d8118e3Copy full SHA for d8118e3
index.js
@@ -93,6 +93,12 @@ http.createServer(function (req, res) {
93
/* Else, proxy the request over to the server */
94
if (!didRespond) {
95
var parsed = url.parse(req.url)
96
+
97
+ // Protect Wordpress, Wikipedia and other sites from their naiveté
98
+ // in assuming that the URIs in the path field aren't absolute.
99
+ // http://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html#sec5.1.2
100
+ req.url = req.url.replace(/.*?\/\/.*?\//, '/');
101
102
proxy.proxyRequest(req, res, {
103
host: parsed.hostname,
104
port: parsed.port || 80,
0 commit comments