mirror of
https://github.com/bitinflow/localtunnel.git
synced 2026-03-13 13:35:54 +00:00
Merge pull request #108 from joshuaxls/master
Fix bug w/ HeaderHostTransformer and binary data
This commit is contained in:
@@ -19,11 +19,11 @@ util.inherits(HeaderHostTransformer, Transform);
|
|||||||
|
|
||||||
HeaderHostTransformer.prototype._transform = function (chunk, enc, cb) {
|
HeaderHostTransformer.prototype._transform = function (chunk, enc, cb) {
|
||||||
var self = this;
|
var self = this;
|
||||||
chunk = chunk.toString();
|
|
||||||
|
|
||||||
// after replacing the first instance of the Host header
|
// after replacing the first instance of the Host header
|
||||||
// we just become a regular passthrough
|
// we just become a regular passthrough
|
||||||
if (!self.replaced) {
|
if (!self.replaced) {
|
||||||
|
chunk = chunk.toString();
|
||||||
self.push(chunk.replace(/(\r\nHost: )\S+/, function(match, $1) {
|
self.push(chunk.replace(/(\r\nHost: )\S+/, function(match, $1) {
|
||||||
self.replaced = true;
|
self.replaced = true;
|
||||||
return $1 + self.host;
|
return $1 + self.host;
|
||||||
|
|||||||
Reference in New Issue
Block a user