Skip to content

Conversation

@sshen81
Copy link

@sshen81 sshen81 commented Mar 28, 2016

When provided a URI that is not a valid text/html document, passing the data into cheerio can result in a call stack overflow.

This modification performs a HEAD request first & verifies that the URI content-type response header contains 'text/html'. If it does not, the meta inspector will emit an invalid data type error.

@gabceb
Copy link
Owner

gabceb commented May 19, 2016

Cant we avoid the HEAD request and just check on the content-type header before we load cheerio with the response body.

Relevant code: https://github.com/gabceb/node-metainspector/blob/master/index.js#L307

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants