nodejitsu/smart-private-npm — pull request #24 by doublerebel (2014-09-12 03:04:33+00:00)
Title: [fix] X-Forwarded-Host header is incompatible with npm

Hello,

I discovered that when `X-Forwarded-Host` header is set, **npm** responds with a `404`, and:
```json
{"error":"not_found","reason":"no_db_file"}
```
This issue can be replicated with `curl` and any value for `X-Forwarded-Host`:
```sh
curl -H "X-Forwarded-Host: google.com" https://registry.npmjs.org/underscore
```
I guess the proxy setup used at npm is confused by the header. The proxy on OpenShift that forwards to my **smart-private-npm** instance sets the header. Removing the header before creating the **http-proxy** solves the issue.

I have tested with all `X-Forwarded-*` and other headers set by OpenShift proxy, and none cause any issue.