Code

Ticket #4416: httpresponse503.patch

File httpresponse503.patch, 531 bytes (added by semente, 7 years ago)

HttpResponse for status code 503 patch

  • django/http/__init__.py

     
    304304    def __init__(self, *args, **kwargs): 
    305305        HttpResponse.__init__(self, *args, **kwargs) 
    306306 
     307class HttpResponseServiceUnavailable(HttpResponse): 
     308    status_code = 503 
     309 
    307310def get_host(request): 
    308311    "Gets the HTTP host from the environment or request headers." 
    309312    host = request.META.get('HTTP_X_FORWARDED_HOST', '')