Permalink
Browse files

* Fixed: js error when accept-encoding header is missing

  • Loading branch information...
1 parent 2787824 commit c54597a4773a71cfd99cf34086e61bc26ac5f33b @joehewitt committed Oct 3, 2011
Showing with 2 additions and 1 deletion.
  1. +2 −1 cache.js
View
@@ -148,7 +148,8 @@ function canZipType(mimeType) {
}
function requestAccepts(req, encoding) {
- var accepts = 'accept-encoding' in req.headers ? req.header('accept-encoding').split(/\s*,\s*/) : [];
+ var header = 'accept-encoding' in req.headers ? req.header('accept-encoding') || '' : '';
+ var accepts = header.split(/\s*,\s*/);
return accepts.indexOf(encoding) != -1;
}

0 comments on commit c54597a

Please sign in to comment.