From e1cfb1957feaf89408bccf48fae6f529e57a82fe Mon Sep 17 00:00:00 2001 From: Hendrixer Date: Sat, 11 Jan 2014 15:20:54 -0800 Subject: fix($http): ensure default headers PUT and POST are different objects Send PUT and POST through copy() to make sure they are not the same. Closes #5742 Closes #5747 Closes #5764 --- test/ng/httpSpec.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test/ng/httpSpec.js') diff --git a/test/ng/httpSpec.js b/test/ng/httpSpec.js index d3653a67..a0417d9a 100644 --- a/test/ng/httpSpec.js +++ b/test/ng/httpSpec.js @@ -1439,6 +1439,12 @@ describe('$http', function() { $http.get('/url'); $httpBackend.flush(); }); + + it('should have seperate opbjects for defaults PUT and POST', function() { + expect($http.defaults.headers.post).not.toBe($http.defaults.headers.put); + expect($http.defaults.headers.post).not.toBe($http.defaults.headers.patch); + expect($http.defaults.headers.put).not.toBe($http.defaults.headers.patch); + }) }); }); -- cgit v1.2.3