Skip to content

Commit

Permalink
Hotfix for fetch on Chrome Canary. Fixes #133
Browse files Browse the repository at this point in the history
  • Loading branch information
jhollingworth committed Mar 3, 2015
1 parent f833070 commit e4f37e0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
2 changes: 1 addition & 1 deletion karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ module.exports = function (config) {
function local() {
return _.extend(base(), {
reporters: ['spec'],
browsers: ['Chrome'],
browsers: ['ChromeCanary'],
autoWatch: true,
singleRun: false,
colors: true
Expand Down
8 changes: 1 addition & 7 deletions lib/stateSources/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function HttpStateSource(mixinOptions) {
});

function isJson(res) {
var contentTypes = getHeader(res, CONTENT_TYPE);
var contentTypes = res.headers.get(CONTENT_TYPE);

if (!_.isArray(contentTypes)) {
if (contentTypes === undefined || contentTypes === null) {
Expand All @@ -56,12 +56,6 @@ function HttpStateSource(mixinOptions) {
});
}

function getHeader(res, name) {
return _.find(res.headers.map, function (value, key) {
return key.toLowerCase() === name.toLowerCase();
});
}

function contentType() {
return options.headers[CONTENT_TYPE] || JSON_CONTENT_TYPE;
}
Expand Down

0 comments on commit e4f37e0

Please sign in to comment.