Stop using a 5xx error code for maintenance mode

Created on 24 February 2016, over 8 years ago
Updated 13 March 2023, over 1 year ago

Drupal currently returns a 503 HTTP status when the site is in maintenance mode. I believe this is based on a misunderstanding of HTTP. Maintenance mode in Drupal is not a server error at all (which is what 5xx error codes are supposed to indicate) - it is an explicit decision by the administrator of an application on the server to restrict how users of the application may interact with it. 5xx errors should be used when there's an issue with the web server itself.

Per RFC 2616:

The server is currently unable to handle the request due to a temporary overloading or maintenance of the server. The implication is that this is a temporary condition which will be alleviated after some delay. If known, the length of the delay MAY be indicated in a Retry-After header. If no Retry-After is given, the client SHOULD handle the response as it would for a 500 response.

The first sentence is the money quote. In the case of maintenance mode, I believe we should still simply return a 200 status with the maintenance message.

πŸ“Œ Task
Status

Closed: works as designed

Version

8.2 ⚰️

Component
RoutingΒ  β†’

Last updated about 23 hours ago

Created by

πŸ‡ΊπŸ‡ΈUnited States rszrama

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024