This repository was archived by the owner on Apr 12, 2024. It is now read-only.
Commit 3a75b11
fix($http): remove 'X-Requested-With' from header defaults
X-Requested-With header is rarely used in practice and by using
it all the time we are triggering preflight checks for crossdomain
requests.
We could try detecting if we are doing CORS requests or not, but
it doesn't look like it's worth the trouble.
BREAKING CHANGE: X-Requested-With header is not set by $http service
any more. If anyone actually uses this header it's quite easy to add
it back via:
```
myAppModule.config(['$httpProvider', function($httpProvider) {
$httpProvider.defaults.headers.common["X-Requested-With"] = 'XMLHttpRequest';
}]);
```
Closes #10041 parent a32bc40 commit 3a75b11
2 files changed
+3
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
112 | | - | |
| 111 | + | |
113 | 112 | | |
114 | 113 | | |
115 | 114 | | |
| |||
212 | 211 | | |
213 | 212 | | |
214 | 213 | | |
215 | | - | |
216 | 214 | | |
217 | 215 | | |
218 | 216 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
377 | 377 | | |
378 | 378 | | |
379 | 379 | | |
380 | | - | |
381 | | - | |
| 380 | + | |
382 | 381 | | |
383 | 382 | | |
384 | 383 | | |
| |||
389 | 388 | | |
390 | 389 | | |
391 | 390 | | |
392 | | - | |
393 | 391 | | |
394 | 392 | | |
395 | 393 | | |
| |||
401 | 399 | | |
402 | 400 | | |
403 | 401 | | |
404 | | - | |
405 | 402 | | |
406 | 403 | | |
407 | 404 | | |
| |||
412 | 409 | | |
413 | 410 | | |
414 | 411 | | |
415 | | - | |
416 | | - | |
| 412 | + | |
417 | 413 | | |
418 | 414 | | |
419 | 415 | | |
| |||
424 | 420 | | |
425 | 421 | | |
426 | 422 | | |
427 | | - | |
428 | 423 | | |
429 | 424 | | |
430 | 425 | | |
| |||
0 commit comments