Skip to content
This repository was archived by the owner on Aug 9, 2018. It is now read-only.

Preserve request headers in our overridden $httpBackend. #30

Merged
merged 1 commit into from
May 20, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions lib/ngoverrides.js
Original file line number Diff line number Diff line change
Expand Up @@ -439,16 +439,17 @@ function registerModule(context) {

var thisRequestId = nextRequestId;
nextRequestId++;
// Pass through any headers that were set in the original request
headers = headers || {};
headers.Host = urlParts.host;
var req = pendingRequests[thisRequestId] = module.request(
{
hostname: urlParts.hostname,
port: urlParts.port,
path: urlParts.pathname +
(urlParts.search ? urlParts.search : ''),
method: reqMethod,
headers: {
'Host': urlParts.host
}
headers: headers
},
function (res) {
// ignore responses to aborted requests
Expand Down