-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Fix X-Robots-Tag header valid values check #40715
Conversation
Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes. |
Co-authored-by: ho4ho <42564859+ho4ho@users.noreply.github.com>
Reviewers - after review is all done, merge this and include in 10.12.1 or wait? |
You might also want to create a function in order to move all the checks there. The idea would be to add support for arrays, so you could use Note that I'm just commenting about the code itself. I don't know if the code is right or wrong. |
I'd say wait. My understanding here: |
…ty check readability.
@jvillafanez array is used only during validation. It is not a valid type input. Imho a separate function is not needed. @jnweiger combinations of
With the current code these combinations are not valid:
On the contrary these are valid input:
|
Kudos, SonarCloud Quality Gate passed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be fine assuming there won't be changes in the checks. I mean, the "X-Robots-Tag" header will be the only exception to the exact match of key - values we're checking.
10.12.1 has been merged back to master, so we can merge new stuff like this. |
Thank you |
Description
Currently the only accepted value for the robots tag is
none
but:none
is only used by Google. Check this https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta/name and https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers.X-Robots-Tag': 'noindex nofollow'
, should be considered as validRelated Issue
Motivation and Context
Allow all the possible values of x-robots-tag header and handle duplicate headers if OC is behind a proxy
How Has This Been Tested?
'none, noindex, nofollow, nosnippet, noarchive'
'none, nosnippet, noarchive'
'none'
'nofollow, nosnippet'
[security warning raised]'nosnippet, noarchive'
[security warning raised]'noindex, nofollow'
''
[security warning raised]Types of changes
Checklist: