-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Include user's index preference in account API #1164
Conversation
3rd party sites allow indexing of user profiles. Perhaps they will implement noindex if the user's preference is easily accessible. This is an implementation of this request: https://www.reddit.com/r/ideasfortheadmins/comments/2ktryi/allow_reddit_clients_to_respect_users_noindex/
For the account API, if the user prefers not to be indexed, set the HTTP response header `X-Robots-Tag` to noindex. If the user has no preference on indexing, then the header is never set.
The approach seems reasonable to me. If we're adding another field to the response data, that should probably be included in the documentation, although I'm not really sure where that lives. Actually from glancing at it, I think we don't currently document responses? This is very unfamiliar territory for me. |
Responses aren't currently documented. |
@@ -33,6 +33,7 @@ | |||
import time, pytz | |||
from pylons import c, g | |||
from pylons.i18n import _ | |||
from pylons import response |
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 merged with the pylons imports on line 34
Committed requested changes from @kemitche |
(BTW, if you use the appropriate emoji, a bot in irc will ping us.) 💇 |
🐟 |
@lightswitch05 Let me know your reddit username |
@kemitche my reddit name is lightswitch05. Thanks for getting this merged! 😃 |
3rd party sites allow indexing of user profiles. Perhaps they will implement
noindex
if the user's preference is easily accessible. This is an implementation of this request.. I've addedhide_from_robots
value to the response as well asx-robots-tag: noindex
to the header if noindex is enabled.Example response before the change:
Example Response after the change: