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 307 when validating HTML5 #20

Open
danielmbarlow opened this issue Dec 26, 2016 · 0 comments
Open

Error 307 when validating HTML5 #20

danielmbarlow opened this issue Dec 26, 2016 · 0 comments

Comments

@danielmbarlow
Copy link

I thought I would add a note about what I have found in case it helps someone else.

When you try to validate HTML5, you will get a 307 error from validator.w3.org which doesn't explain much. However this means that they recommend using the https://validator.w3.org/nu/ API.

It seems that API doesn't support the soap interface currently in use on this gem, but instead favours a JSON API. (Correct me if I'm wrong here)

Here is an example of how to make it work with cUrl:

curl 'https://validator.w3.org/nu/?out=json' -H 'Content-Type: application/html' -H 'Accept-Encoding: gzip, deflate, br' -H 'Accept: application/json;' -H 'Cache-Control: max-age=0' -H 'Referer: https://validator.w3.org/nu/' --data-binary $'\r\n\r\n<!DOCTYPE html>\r\n<html>\r\n<head>\r\n<title>Test</title>\r\n</head>\r\n<body>\r\n<p></p>\r\n</body>\r\n</html>\r\n' --compressed

Perhaps be_valid_asset-1.3.1/lib/be_valid_asset/be_valid_base.rb:40 needs to be changed to handle the JSON response, although that may not work for XHTML

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

No branches or pull requests

1 participant