Skip to content

Commit

Permalink
Set maintenance mode response Retry-After only if set.
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiocaccamo committed Dec 11, 2023
1 parent 1761b24 commit 62104f9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion maintenance_mode/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ def get_maintenance_response(request):
status=settings.MAINTENANCE_MODE_STATUS_CODE,
**kwargs,
)
response["Retry-After"] = settings.MAINTENANCE_MODE_RETRY_AFTER

if settings.MAINTENANCE_MODE_RETRY_AFTER:
response["Retry-After"] = settings.MAINTENANCE_MODE_RETRY_AFTER

add_never_cache_headers(response)
return response

Expand Down

0 comments on commit 62104f9

Please sign in to comment.