A suitable http status code to enable the browser is not supported?

I do not support IE8 and lower, and based on useragent, it is verified that all requests made from one of these browsers refer to a page where I explain the reason and display links to supported browsers.

Is there an HTTP status code to go along with this? 200 It will not be right, because the user does not receive the page requested by him, and 505 (the version is not supported) refers to the outdated version of HTTP, which is also not the case.

+8
cross-browser rest internet-explorer
source share
3 answers

I vote for

403 Forbidden "The server understood the request, but refuses to fulfill it"

but there is no definitive answer to this question.

+6
source

400 Bad Request

From here :

BadRequest Equivalent to HTTP status 400. BadRequest indicates that the request could not be understood by the server. BadRequest - Dispatched when no other error is applicable , or if the exact error is unknown or does not have its own error code .

+2
source

I would use: 406 is invalid

Note. This is technically misleading because there is not officially a problem with the Accept Accept header, you are just trying to block a specific browser.

Whatever you do, go with the 4xx code. 5xx is for server problems, and 4xx is for client problems β€” in this case, supported browsers are not used.

0
source

All Articles