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

Bad content-length for $resource remove in IE 11, angularjs 1.4.5 #12739

Closed
rpsde opened this issue Sep 2, 2015 · 1 comment
Closed

Bad content-length for $resource remove in IE 11, angularjs 1.4.5 #12739

rpsde opened this issue Sep 2, 2015 · 1 comment

Comments

@rpsde
Copy link

rpsde commented Sep 2, 2015

See plunk at http://plnkr.co/edit/1Pf5wTbjdMqmVQCkJ8il?p=preview.

The angular version is initially 1.4.3 (same problem exists in 1.4.5). In IE 11, when you click the "Test Delete" button and examine the request, notice that the Content-Length is 9 (which corresponds to the text 'undefined').

If you change the version to angular 1.3.18 and repeat, Content-Length is 0, which is correct.

The content-length of 9 with the value of 'undefined' causes the DELETE request to fail at the REST server.

This issue only exists in IE, I'm using version 11.

@gkalpak
Copy link
Member

gkalpak commented Sep 3, 2015

It is e04a887 that causes the different behaviour from earlier versions.
Maybe we should change xhr.send(post) to xhr.send(isUndefined(post) ? null : post).

@gkalpak gkalpak added this to the 1.4.6 milestone Sep 3, 2015
gkalpak added a commit to gkalpak/angular.js that referenced this issue Sep 3, 2015
IE11 (and maybe others) converts an `undefined` argument to `xhr.send()` to
string (`'undefined'`) for certain request methods (e.g. DELETE). This
causes the request to appear having a body, when it shouldn't.

Closes angular#12739
gkalpak added a commit to gkalpak/angular.js that referenced this issue Sep 3, 2015
IE11 (and maybe others) converts an `undefined` argument to `xhr.send()` to
string (`'undefined'`) for certain request methods (e.g. DELETE). This
causes the request to appear having a body, when it shouldn't.

Closes angular#12739
Closes angular#12745
gkalpak added a commit to gkalpak/angular.js that referenced this issue Sep 3, 2015
IE11 (and maybe others) converts an `undefined` argument to `xhr.send()` to
string (`'undefined'`) for certain request methods (e.g. DELETE). This
causes the request to appear having a body, when it shouldn't.

Closes angular#12739
gkalpak added a commit to gkalpak/angular.js that referenced this issue Sep 3, 2015
IE11 (and maybe others) converts an `undefined` argument to `xhr.send()` to
string (`'undefined'`) for certain request methods (e.g. DELETE). This
causes the request to appear having a body, when it shouldn't.

Fixes angular#12141
Fixes angular#12739
@gkalpak gkalpak closed this as completed in 6f39f10 Sep 3, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants