mirror of
https://github.com/django/django.git
synced 2025-06-05 03:29:12 +00:00
Refs #23960 -- Documented how to restore absolute redirect URLs.
This commit is contained in:
parent
5fb22b4d4c
commit
08b8c46971
@ -794,6 +794,16 @@ no longer include the scheme and domain part of the URLs. For example,
|
|||||||
replaced by ``self.assertRedirects(response, '/some-url/')`` (unless the
|
replaced by ``self.assertRedirects(response, '/some-url/')`` (unless the
|
||||||
redirection specifically contained an absolute URL, of course).
|
redirection specifically contained an absolute URL, of course).
|
||||||
|
|
||||||
|
In the rare case that you need the old behavior (discovered with an ancient
|
||||||
|
version of Apache with ``mod_scgi`` that interprets a relative redirect as an
|
||||||
|
"internal redirect", you can restore it by writing a custom middleware::
|
||||||
|
|
||||||
|
class LocationHeaderFix(object):
|
||||||
|
def process_response(self, request, response):
|
||||||
|
if 'Location' in response:
|
||||||
|
response['Location'] = request.build_absolute_uri(response['Location'])
|
||||||
|
return response
|
||||||
|
|
||||||
Dropped support for PostgreSQL 9.0
|
Dropped support for PostgreSQL 9.0
|
||||||
----------------------------------
|
----------------------------------
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user