Skip to content

Commit

Permalink
add skipHeaderSanitize test
Browse files Browse the repository at this point in the history
  • Loading branch information
SidneyJiang committed Mar 25, 2022
1 parent a608d09 commit 08e181a
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/leak.test.js
Expand Up @@ -126,5 +126,25 @@ describe('Information Leak', function () {
done();
});
});


it('should forward authorization headers regardless if skipHeaderSanitize is set to true', function (done) {

request({
url: 'https://httpbingo.org/redirect-to?url=http://httpbingo.org/bearer',
headers: {
'Content-Type': 'application/json',
'cookie': 'ajs_anonymous_id=1234567890',
'authorization': 'Bearer eyJhb12345abcdef'
},
skipHeaderSanitize: true
}, function (err, response, body) {
t.deepEqual(body, {
"authenticated": true,
"token": "eyJhb12345abcdef"
});
done();
});
});

});

0 comments on commit 08e181a

Please sign in to comment.