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:

committed by
Martin Probst

parent
e1fcab777c
commit
537e99b4ea
@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user