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

Specifying a User-Agent? #51

Closed
jaimeiniesta opened this issue Mar 6, 2015 · 5 comments
Closed

Specifying a User-Agent? #51

jaimeiniesta opened this issue Mar 6, 2015 · 5 comments

Comments

@jaimeiniesta
Copy link
Contributor

Is it possible to specify a different User-Agent string per request? I've seen this can be set on the build, but can it be changed on runtime, like on the W3C legacy validator accepts a user-agent param?

This can help when validating web pages that respond with different contents depending on the User-Agent string, I've seen cases where the web developers were confused about getting issues related to content that they did not see when browsing the page, and thought there was some kind of cache.

For example, this is a validation of a page and this is the same validation with a browser-like User-Agent.

@sideshowbarker
Copy link
Contributor

This is a good idea.

There's nothing yet exposed by the vnu code that’d enable it but as far as I can see it’d be feasible to add it as a new input param https://wiki.whatwg.org/wiki/Validator.nu_Common_Input_Parameters

If we add support in the code I think I'd still be reluctant myself to expose anything for it in the http://validator.w3.org/nu/ UI—just because it adds complexity to the UI for a feature that the vast majority of users don't need. Of course any user could still add it manually to the query part of the request URL, though they'd have to escape it correctly.

Still it'd be there regardless for any consumers of the checker’s HTTP/REST/Web-services API.

@jaimeiniesta
Copy link
Contributor Author

Cool, I also think that it would be better to not clutter the UI with a new input as most users are not going to use it, but it would be great to be able to pass it as a query parameter.

@sideshowbarker
Copy link
Contributor

OK. BTW the docs at http://validator.w3.org/docs/users.html#option-user-agent imply there's an option fo this provided in the Web UI but I notice that http://validator.w3.org/ doesn't actually seem to expose such an option in its UI. Is that true? Or am I missing something? I realize it's supported in the backend—just wondering what mechanism if any there is for it, other than just adding it to the URL manually.

@jaimeiniesta
Copy link
Contributor Author

I don't remember seeing an input for it on the UI. All that there is now is a hidden input used to remember its setting, for the Revalidate form.

sideshowbarker added a commit that referenced this issue Mar 25, 2015
Improves #51. This only exposes anything additional in browsers that
support the `datalist` element.
@jaimeiniesta
Copy link
Contributor Author

Thanks, I've added the option to specify a User-Agent string to nunchaku 0.2.0.

tripu pushed a commit to tripu/validator that referenced this issue Aug 19, 2016
tripu pushed a commit to tripu/validator that referenced this issue Aug 19, 2016
Improves validator#51. This only exposes anything additional in browsers that
support the `datalist` element.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants