angular.js icon indicating copy to clipboard operation
angular.js copied to clipboard

Custom content-length header is removed from http delete request

Open stinaq opened this issue 12 years ago • 1 comments

Delete request to nginx server returns 411, length required, but attempts to set content-length header gets removed by angular

$http({
    method: 'DELETE',
    url: url,
    headers: {
      'Content-Length': 0
    }
  });

stinaq avatar Apr 08 '14 07:04 stinaq

It's not removed by Angular, it's forbidden (can't be set) by the browser:

https://github.com/mirrors/blink/blob/320380e5a2821d248ece1cb502c8c397150a431f/Source/core/xml/XMLHttpRequest.cpp#L1087

https://github.com/mirrors/blink/blob/320380e5a2821d248ece1cb502c8c397150a431f/Source/core/xml/XMLHttpRequest.cpp#L82-L107

caitp avatar Apr 08 '14 17:04 caitp