Skip to content

Commit 747ebb8

Browse files
author
Robert Damphousse
committed
Fix issue where Content-Type was set twice
1 parent 23554ed commit 747ebb8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/services/BaseService.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,10 @@ function makeHttpRequest(method, uri, body, headers, callback) {
4545
};
4646

4747
if (body && typeof body === 'object') {
48-
request.setRequestHeader('Content-Type', 'application/json; charset=utf-8');
48+
// Avoid setting if the content type if it is explicitly specified in the headers
49+
if (typeof headers['ContentType'] === undefined) {
50+
request.setRequestHeader('Content-Type', 'application/json; charset=utf-8');
51+
}
4952
request.send(JSON.stringify(body));
5053
} else {
5154
request.send();

0 commit comments

Comments
 (0)