Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

fix($http) Don't try to JSON.stringify FormData objects #10373

Closed
wants to merge 1 commit into from

Conversation

realityking
Copy link
Contributor

This won't enable FormData uploads in itself, as the Content-Type is automatically set to application/json.

@googlebot
Copy link

CLAs look good, thanks!

@@ -991,6 +991,15 @@ describe('$http', function() {
$http({ method: 'POST', url: '/url', data: blob });
});

it('should ignore FormData objects', function() {
if (!window.Blob) return;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be window.FormData ?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch @gkalpak !

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for noticing that, fixed now.

@pkozlowski-opensource
Copy link
Member

@realityking thnx for the PR, it generally looks good to me. You just need to fix a pb spotted by @gkalpak. Personally I would also change the commit message to sth like fix($http): don't convert FormData objects to JSON.

@pkozlowski-opensource pkozlowski-opensource added this to the 1.3.7 milestone Dec 9, 2014
@pkozlowski-opensource pkozlowski-opensource self-assigned this Dec 9, 2014
This won't enable FormData uploads in itself, as the Content-Type is automatically set to application/json.
@realityking
Copy link
Contributor Author

@pkozlowski-opensource I've changed the commit message as well.

@pkozlowski-opensource
Copy link
Member

LGTM

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants