Opened 8 years ago

Last modified 8 years ago

#27606 closed Bug

Error in formatting HttpResponseRedirect — at Version 1

Reported by: Jerome Leclanche Owned by: nobody
Component: HTTP handling Version: 1.10
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description (last modified by Jerome Leclanche)

When initializing an HttpResponseRedirect with a redirect url that does not match the allowed_schemes attribute, the DisallowedRedirect exception is raised before super(HttpResponseRedirectBase, self).__init__(*args, **kwargs) is called, which sets self._headers.

This causes repr()ing/printing the response to error out with AttributeError: 'HttpResponseRedirect' object has no attribute '_headers'.

Ref: django/http/response.py (HttpResponseRedirectBase)

Change History (1)

comment:1 by Jerome Leclanche, 8 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.
Back to Top