fix(http): respect custom Content-Type header in XHRConnection (#9131)

Fix a bug due to which setting a custom Content-Type header in the
Request led to multiple Content-Types being set on the sent
XMLHttpRequest: first the detected content type based on the request
body, followed by the custom set content type.

Fix #9130.
This commit is contained in:
Vivek Ghaisas
2016-06-10 17:18:49 +02:00
committed by Martin Probst
parent e1fcab777c
commit 537e99b4ea
2 changed files with 13 additions and 1 deletions

View File

@ -108,7 +108,7 @@ export class XHRConnection implements Connection {
setDetectedContentType(req: any /** TODO #9100 */, _xhr: any /** TODO #9100 */) {
// Skip if a custom Content-Type header is provided
if (isPresent(req.headers) && isPresent(req.headers['Content-Type'])) {
if (isPresent(req.headers) && isPresent(req.headers.get('Content-Type'))) {
return;
}