fix(http): headers should be case-insensitive.
fixes #9452 spec at https://tools.ietf.org/html/rfc2616
This commit is contained in:

committed by
Victor Berchet

parent
e34a04d2ad
commit
7f647822bd
@ -152,18 +152,18 @@ export class XHRConnection implements Connection {
|
||||
case ContentType.NONE:
|
||||
break;
|
||||
case ContentType.JSON:
|
||||
_xhr.setRequestHeader('Content-Type', 'application/json');
|
||||
_xhr.setRequestHeader('content-type', 'application/json');
|
||||
break;
|
||||
case ContentType.FORM:
|
||||
_xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded;charset=UTF-8');
|
||||
_xhr.setRequestHeader('content-type', 'application/x-www-form-urlencoded;charset=UTF-8');
|
||||
break;
|
||||
case ContentType.TEXT:
|
||||
_xhr.setRequestHeader('Content-Type', 'text/plain');
|
||||
_xhr.setRequestHeader('content-type', 'text/plain');
|
||||
break;
|
||||
case ContentType.BLOB:
|
||||
var blob = req.blob();
|
||||
if (blob.type) {
|
||||
_xhr.setRequestHeader('Content-Type', blob.type);
|
||||
_xhr.setRequestHeader('content-type', blob.type);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user