File tree 2 files changed +9
-5
lines changed
2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -111,9 +111,9 @@ function $HttpProvider() {
111
111
common : {
112
112
'Accept' : 'application/json, text/plain, */*'
113
113
} ,
114
- post : CONTENT_TYPE_APPLICATION_JSON ,
115
- put : CONTENT_TYPE_APPLICATION_JSON ,
116
- patch : CONTENT_TYPE_APPLICATION_JSON
114
+ post : copy ( CONTENT_TYPE_APPLICATION_JSON ) ,
115
+ put : copy ( CONTENT_TYPE_APPLICATION_JSON ) ,
116
+ patch : copy ( CONTENT_TYPE_APPLICATION_JSON )
117
117
} ,
118
118
119
119
xsrfCookieName : 'XSRF-TOKEN' ,
Original file line number Diff line number Diff line change @@ -1428,9 +1428,13 @@ describe('$http', function() {
1428
1428
1429
1429
describe ( 'defaults' , function ( ) {
1430
1430
1431
- it ( 'should expose the defaults object at runtime' , function ( ) {
1432
- expect ( $http . defaults ) . toBeDefined ( ) ;
1431
+ it ( 'should ensure that default headers are different objects' , function ( ) {
1432
+ expect ( $http . defaults . headers . post ) . not . toBe ( $http . defaults . headers . put ) ;
1433
+ expect ( $http . defaults . headers . put ) . not . toBe ( $http . defaults . headers . patch ) ;
1434
+ expect ( $http . defaults . headers . patch ) . not . toBe ( $http . defaults . headers . post ) ;
1435
+ } ) ;
1433
1436
1437
+ it ( 'should expose the defaults object at runtime' , function ( ) {
1434
1438
$http . defaults . headers . common . foo = 'bar' ;
1435
1439
$httpBackend . expect ( 'GET' , '/url' , undefined , function ( headers ) {
1436
1440
return headers [ 'foo' ] == 'bar' ;
You can’t perform that action at this time.
0 commit comments