From 86182a9415b9209662b16c25c180b958ba7e6cf9 Mon Sep 17 00:00:00 2001 From: Vojta Jina Date: Tue, 3 Apr 2012 11:00:52 -0700 Subject: feat($http): add withCredentials config option --- src/ng/httpBackend.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/ng/httpBackend.js') diff --git a/src/ng/httpBackend.js b/src/ng/httpBackend.js index abe1d8f5..b2c14b3f 100644 --- a/src/ng/httpBackend.js +++ b/src/ng/httpBackend.js @@ -32,7 +32,7 @@ function $HttpBackendProvider() { function createHttpBackend($browser, XHR, $browserDefer, callbacks, body, locationProtocol) { // TODO(vojta): fix the signature - return function(method, url, post, callback, headers, timeout) { + return function(method, url, post, callback, headers, timeout, withCredentials) { $browser.$$incOutstandingRequestCount(); url = url || $browser.url(); @@ -71,6 +71,10 @@ function createHttpBackend($browser, XHR, $browserDefer, callbacks, body, locati } }; + if (withCredentials) { + xhr.withCredentials = true; + } + xhr.send(post || ''); if (timeout > 0) { -- cgit v1.2.3