Skip to content

Commit 4c335a1

Browse files
prepare 3.2.9 release (#26)
1 parent ac3e311 commit 4c335a1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Requestor.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,11 @@ export default function Requestor(platform, options, environment) {
4949
const p = req.promise.then(
5050
result => {
5151
if (result.status === 200) {
52-
if (result.header('content-type') && result.header('content-type').startsWith(jsonContentType)) {
52+
// We're using substring here because using startsWith would require a polyfill in IE.
53+
if (
54+
result.header('content-type') &&
55+
result.header('content-type').substring(0, jsonContentType.length) === jsonContentType
56+
) {
5357
return JSON.parse(result.body);
5458
} else {
5559
const message = messages.invalidContentType(result.header('content-type') || '');

0 commit comments

Comments
 (0)