Skip to content

Commit

Permalink
check for wildcard browser accepts with a string object method
Browse files Browse the repository at this point in the history
  • Loading branch information
scasei committed Sep 28, 2010
1 parent db2f64f commit bc08a93
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions geddy-core/lib/controller.js
Expand Up @@ -257,9 +257,13 @@ Controller.prototype = new function () {
// Ignore quality factors for now
for (var i = 0, ii = accepts.length; i < ii; i++) {
accepts[i] = accepts[i].split(';')[0];
if (accepts[i] == '*/*') {
wildcard = true;
// We need a string operation here, due to different charset encodings of browser headers
if (accepts[i].indexOf('*/*') < 0) {
continue;
}

wildcard = true;
break;
}

// If agent accepts anything, respond with the controller's first choice
Expand Down

0 comments on commit bc08a93

Please sign in to comment.