Skip to content

Commit 5850e61

Browse files
committed
docs(CHANGELOG): add breaking change notice for 1.2.9 $http default headers change
Add a mention for the slightly breaking change introduced in 1.2.9. Closes angular#6022
1 parent d2e4e49 commit 5850e61

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

CHANGELOG.md

+24
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,30 @@
8282
([4ae3184c](https://github.com/angular/angular.js/commit/4ae3184c5915aac9aa00889aa2153c8e84c14966),
8383
[#4278](https://github.com/angular/angular.js/issues/4278), [#4225](https://github.com/angular/angular.js/issues/4225))
8484

85+
## Breaking Changes
86+
87+
- **$http:** due to [e1cfb195](https://github.com/angular/angular.js/commit/e1cfb1957feaf89408bccf48fae6f529e57a82fe),
88+
it is now necessary to seperately specify default HTTP headers for PUT, POST and PATCH requests, as these no longer share a single object.
89+
90+
To migrate your code, follow the example below:
91+
92+
Before:
93+
94+
// Will apply to POST, PUT and PATCH methods
95+
$httpProvider.defaults.headers.post = {
96+
"X-MY-CSRF-HEADER": "..."
97+
};
98+
99+
After:
100+
101+
// POST, PUT and PATCH default headers must be specified seperately,
102+
// as they do not share data.
103+
$httpProvider.defaults.headers.post =
104+
$httpProvider.defaults.headers.put =
105+
$httpProviders.defaults.headers.patch = {
106+
"X-MY-CSRF-HEADER": "..."
107+
};
108+
85109
<a name="1.2.8"></a>
86110
# 1.2.8 interdimensional-cartography (2014-01-10)
87111

0 commit comments

Comments
 (0)