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

Commit 5762327

Browse files
committed
Merge pull request #30 from kshay/master
Preserve request headers in our overridden $httpBackend.
2 parents 92c9d60 + 04255be commit 5762327

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/ngoverrides.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -439,16 +439,17 @@ function registerModule(context) {
439439

440440
var thisRequestId = nextRequestId;
441441
nextRequestId++;
442+
// Pass through any headers that were set in the original request
443+
headers = headers || {};
444+
headers.Host = urlParts.host;
442445
var req = pendingRequests[thisRequestId] = module.request(
443446
{
444447
hostname: urlParts.hostname,
445448
port: urlParts.port,
446449
path: urlParts.pathname +
447450
(urlParts.search ? urlParts.search : ''),
448451
method: reqMethod,
449-
headers: {
450-
'Host': urlParts.host
451-
}
452+
headers: headers
452453
},
453454
function (res) {
454455
// ignore responses to aborted requests

0 commit comments

Comments
 (0)