Skip to content

Commit 2afd8c9

Browse files
authored
fix: jquery doesn't like the case insensitive selector (#274)
1 parent 9bf88b0 commit 2afd8c9

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/resource/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,11 @@ const Resource = {
6666
let $ = cheerio.load(decodedContent);
6767

6868
// after first cheerio.load, check to see if encoding matches
69+
const contentTypeSelector = cheerio.browser
70+
? 'meta[http-equiv=content-type]'
71+
: 'meta[http-equiv=content-type i]';
6972
const metaContentType =
70-
$('meta[http-equiv=content-type i]').attr('content') ||
73+
$(contentTypeSelector).attr('content') ||
7174
$('meta[charset]').attr('charset');
7275
const properEncoding = getEncoding(metaContentType);
7376

0 commit comments

Comments
 (0)