wp-ban icon indicating copy to clipboard operation
wp-ban copied to clipboard

Recommend changing status codes for ban messages

Open nullvariable opened this issue 4 years ago • 1 comments

Currently this plugin responds with a 200 status code for ban messages. This can cause caching systems to cache the page for users who are not banned, resulting in them seeing the ban message even though they are not banned. I would recommend responding with a 401 or 403 status code (or making this configurable.

For example, Pantheon's CDN will cache the banned message if a banned visitor accesses a page before other visitors causing the ban message to be shown to all users until that page falls out of the cache.

nullvariable avatar Feb 10 '21 20:02 nullvariable

I think that is a good idea, somewhere along the lines of using https://developer.wordpress.org/reference/functions/status_header/, but sadly I will not have time to work on this, feel free to send in a PR if you want to =)

lesterchan avatar Feb 11 '21 07:02 lesterchan