Ticket #20328: http_status_text.patch

File http_status_text.patch, 746 bytes (added by Anler Hp, 12 years ago)
  • django/core/handlers/wsgi.py

    diff --git a/django/core/handlers/wsgi.py b/django/core/handlers/wsgi.py
    index a9fa094..fdbdea5 100644
    a b class WSGIHandler(base.BaseHandler):  
    260260            status_text = STATUS_CODE_TEXT[response.status_code]
    261261        except KeyError:
    262262            status_text = 'UNKNOWN STATUS CODE'
    263         status = '%s %s' % (response.status_code, status_text)
     263        status = '%s %s' % (response.status_code, getattr(response, 'status_text', None) or status_text)
    264264        response_headers = [(str(k), str(v)) for k, v in response.items()]
    265265        for c in response.cookies.values():
    266266            response_headers.append((str('Set-Cookie'), str(c.output(header=''))))
Back to Top