Skip to content

Commit

Permalink
Merge pull request #1857 from simov/fix-referer
Browse files Browse the repository at this point in the history
Fix Referer header to point to the original host name
  • Loading branch information
simov committed Oct 24, 2015
2 parents 84a5ea3 + 2d997e5 commit d18cb48
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/redirect.js
Expand Up @@ -140,7 +140,7 @@ Redirect.prototype.onResponse = function (response) {
}

if (!self.removeRefererHeader) {
request.setHeader('referer', request.uri.href)
request.setHeader('referer', uriPrev.href)
}

request.emit('redirect')
Expand Down
2 changes: 1 addition & 1 deletion tests/test-redirect.js
Expand Up @@ -345,7 +345,7 @@ tape('should have the referer when following redirect by default', function(t) {
})
.on('redirect', function() {
t.notEqual(this.headers.referer, undefined)
t.equal(this.headers.referer.substring(this.headers.referer.lastIndexOf('/')), '/temp_landing')
t.equal(this.headers.referer.substring(this.headers.referer.lastIndexOf('/')), '/temp')
})
})

Expand Down

0 comments on commit d18cb48

Please sign in to comment.