angular.js
angular.js copied to clipboard
Custom content-length header is removed from http delete request
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
}
});
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