Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error when not html deserved #9

Closed
naonak opened this issue Jul 22, 2011 · 4 comments
Closed

error when not html deserved #9

naonak opened this issue Jul 22, 2011 · 4 comments
Labels

Comments

@naonak
Copy link

naonak commented Jul 22, 2011

Sometimes, link seem to deserve html and finaly, not...
Actually, that cause error (jsdom).

I propose to add something like that (line 118) :

                        var contentType =  response.headers['content-type'] || false;
                        if (contentType && contentType.indexOf('text/html') < 0
                            || contentType.indexOf('application/xhtml') < 0
                            || contentType.indexOf('application/xml') < 0) {
                            return ???????
                        }
@naonak
Copy link
Author

naonak commented Jul 22, 2011

fix :
var contentType = response.headers['content-type'] || false;
if (contentType && contentType.indexOf('text/html') < 0
&& contentType.indexOf('application/xhtml') < 0
&& contentType.indexOf('application/xml') < 0) {
return ???????
}

sylvinus added a commit that referenced this issue Sep 10, 2012
@sylvinus
Copy link
Collaborator

Will work on this in next update

@windcbf
Copy link

windcbf commented Nov 1, 2012

+1 for @naonak 's change.

There are many cases that a link is pointing to a binary file (e.g. exe, ISO). The crawler would still try to download those files and feed it into JSDOM.

@ghost
Copy link

ghost commented Nov 8, 2014

Merged with other issue

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants