mirror of
https://github.com/bitinflow/localtunnel.git
synced 2026-03-13 13:35:54 +00:00
fix host header transform to support Host and host header
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
language: node_js
|
||||
sudo: false
|
||||
node_js:
|
||||
- "4"
|
||||
- "6"
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
# UNRELEASED
|
||||
|
||||
* fix host header transform
|
||||
* update request dependency
|
||||
|
||||
# 1.8.1 (2016-01-20)
|
||||
|
||||
@@ -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;
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user