Skip to content

Commit

Permalink
🐛 prevent Illegal invocation error when no mimeType is set
Browse files Browse the repository at this point in the history
  • Loading branch information
philschatz committed Jan 18, 2017
1 parent 241a7d5 commit 080345f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 5 additions & 3 deletions dist/octokat.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion src/requester.js
Expand Up @@ -13,7 +13,9 @@ let ajax = function (options, cb) {
const XMLHttpRequest = require('./adapters/xhr')
let xhr = new XMLHttpRequest()
xhr.dataType = options.dataType
__guardFunc__(xhr.overrideMimeType, f => f(options.mimeType))
if (options.mimeType) {
__guardFunc__(xhr.overrideMimeType, f => f(options.mimeType))
}
xhr.open(options.type, options.url)

if (options.data && options.type !== 'GET') {
Expand Down

0 comments on commit 080345f

Please sign in to comment.