Opened 9 years ago
Last modified 9 years ago
#27606 closed Bug
Error in formatting HttpResponseRedirect — at Initial Version
| 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
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)
Note:
See TracTickets
for help on using tickets.