This repository has been archived by the owner on Apr 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27.4k
$http ignores HTTP headers with falsy values #2984
Comments
As part of our effort to clean out old issues, this issue is being automatically closed since it has been inactivite for over two months. Please try the newest versions of Angular ( Thanks! |
This issue persists on |
Thanks for verifying! |
ghost
assigned btford
Oct 1, 2013
btford
pushed a commit
to btford/angular.js
that referenced
this issue
Oct 1, 2013
Before this commit you could let the browser set the Content-Type header by passing {'Content-Type': false}, but this no longer works. This is problematic when submitting FormData as multipart/form-data, because the boundary is not known in advance. EDIT: the answer seems to be to pass {'Content-Type': undefined} |
@jlaine Thank you! I just ran into this problem |
jamesdaily
pushed a commit
to jamesdaily/angular.js
that referenced
this issue
Jan 27, 2014
This is a breaking change. To migrate to the new behavior, delete or set headers to `undefined` to avoid having them sent. To restore the old behavior, override `$httpBackendProvider` with the old implementation. Closes angular#2984
jamesdaily
pushed a commit
to jamesdaily/angular.js
that referenced
this issue
Jan 27, 2014
This is a breaking change. To migrate to the new behavior, delete or set headers to `undefined` to avoid having them sent. To restore the old behavior, override `$httpBackendProvider` with the old implementation. Closes angular#2984
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
$http
does not send HTTP headers if they have falsy values. For example following code does not work, header is not sent.This issue occurs at minimum in the unstable version of Angular and master.
Here is a failing test-case for
$httpBackend
which demonstrates the issue:The text was updated successfully, but these errors were encountered: