fix host header transform to support Host and host header

This commit is contained in:
Roman Shtylman
2016-11-17 22:28:34 -08:00
parent edc182125f
commit b9c1901d60
3 changed files with 3 additions and 2 deletions

View File

@@ -24,7 +24,7 @@ HeaderHostTransformer.prototype._transform = function (chunk, enc, cb) {
// we just become a regular passthrough
if (!self.replaced) {
chunk = chunk.toString();
self.push(chunk.replace(/(\r\nHost: )\S+/, function(match, $1) {
self.push(chunk.replace(/(\r\n[Hh]ost: )\S+/, function(match, $1) {
self.replaced = true;
return $1 + self.host;
}));