File tree 2 files changed +10
-4
lines changed
2 files changed +10
-4
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' ,
@@ -324,7 +324,7 @@ function $HttpProvider() {
324
324
* to `push` or `unshift` a new transformation function into the transformation chain. You can
325
325
* also decide to completely override any default transformations by assigning your
326
326
* transformation functions to these properties directly without the array wrapper. These defaults
327
- * are again available on the $http factory at run-time, which may be useful if you have run-time
327
+ * are again available on the $http factory at run-time, which may be useful if you have run-time
328
328
* services you wish to be involved in your transformations.
329
329
*
330
330
* Similarly, to locally override the request/response transforms, augment the
Original file line number Diff line number Diff line change @@ -1439,6 +1439,12 @@ describe('$http', function() {
1439
1439
$http . get ( '/url' ) ;
1440
1440
$httpBackend . flush ( ) ;
1441
1441
} ) ;
1442
+
1443
+ it ( 'should have seperate opbjects for defaults PUT and POST' , function ( ) {
1444
+ expect ( $http . defaults . headers . post ) . not . toBe ( $http . defaults . headers . put ) ;
1445
+ expect ( $http . defaults . headers . post ) . not . toBe ( $http . defaults . headers . patch ) ;
1446
+ expect ( $http . defaults . headers . put ) . not . toBe ( $http . defaults . headers . patch ) ;
1447
+ } )
1442
1448
} ) ;
1443
1449
} ) ;
1444
1450
You can’t perform that action at this time.
0 commit comments