From e9a222418a029d830698444cf95bf13f8ad75805 Mon Sep 17 00:00:00 2001 From: Ricardo Bin Date: Tue, 3 Sep 2013 18:19:38 -0300 Subject: fix($httpBackend): set headers with falsy values This is a breaking change. To migrate to the new behavior, delete or set headers to `undefined` to avoid having them sent. To restore the old behavior, override `$httpBackendProvider` with the old implementation. Closes #2984 --- src/ng/httpBackend.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/ng/httpBackend.js') diff --git a/src/ng/httpBackend.js b/src/ng/httpBackend.js index 99da6549..3e7406b0 100644 --- a/src/ng/httpBackend.js +++ b/src/ng/httpBackend.js @@ -56,7 +56,9 @@ function createHttpBackend($browser, XHR, $browserDefer, callbacks, rawDocument, var xhr = new XHR(); xhr.open(method, url, true); forEach(headers, function(value, key) { - if (value) xhr.setRequestHeader(key, value); + if (isDefined(value)) { + xhr.setRequestHeader(key, value); + } }); // In IE6 and 7, this might be called synchronously when xhr.send below is called and the -- cgit v1.2.3