Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix reqwest for IE. Fixes #151 #152

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions reqwest.js
Expand Up @@ -294,7 +294,10 @@
}

function success (resp) {
var type = o['type'] || setType(resp.getResponseHeader('Content-Type'))
var type = o['type']
if (resp) {
type = setType(resp.getResponseHeader('Content-Type'))
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

means o['type'] will always be thrown away in favour of the response's type, whereas previously it trumped it. Maybe something (ugly) like

var type = o['type'] || ( resp && setType(resp.getResponseHeader('Content-Type')))

resp = (type !== 'jsonp') ? self.request : resp
// use global data filter on response text
var filteredResponse = globalSetupOptions.dataFilter(resp.responseText, type)
Expand Down Expand Up @@ -411,9 +414,6 @@
}
return this
}
, catch: function (fn) {
return this.fail(fn)
}
}

function reqwest(o, fn) {
Expand Down