PREPEND_WWW and APPEND_SLASH settings don't work with flatpages middleware
|Reported by:||Jason Davies||Owned by:||orthagonal|
|Severity:||Normal||Keywords:||APPEND_SLASH PREPEND_WWW flatpages easy-pickings|
|Cc:||semente@…, xarquonster@…, jm.bugtracking@…, che@…, sjl||Triage Stage:||Accepted|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||yes|
APPEND_SLASH settings don't force a redirect when
FlatpageFallbackMiddleware is being used.
This is because a redirect only happens if the target URL can be resolved using
urlresolvers.resolve() in the code.
This behaviour has occurred since the change in .
If the target URL cannot be resolved immediately using
urlresolvers.resolve(), perhaps we should check in
process_response() to make absolutely sure the response status code will be 404? If some intermediate middleware, e.g.
FlatpageFallbackMiddleware has returned a successful response code, we can then issue a redirect as per the old behaviour.
Change History (34)
comment:1 Changed 9 years ago by
|Summary:||PREPEND_WWW and APPEND_SLASH settings don't work with flatpages middleware → PREPEND_WWW setting doesn't work with flatpages middleware|
|Triage Stage:||Unreviewed → Accepted|
comment:5 Changed 9 years ago by
|Summary:||PREPEND_WWW setting doesn't work with flatpages middleware → PREPEND_WWW and APPEND_SLASH settings don't work with flatpages middleware|