PREPEND_WWW and APPEND_SLASH settings don't work with flatpages middleware
|Reported by:||esaj||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|
The PREPEND_WWW and 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 8 years ago by SmileyChris
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
- Summary changed from PREPEND_WWW and APPEND_SLASH settings don't work with flatpages middleware to PREPEND_WWW setting doesn't work with flatpages middleware
- Triage Stage changed from Unreviewed to Accepted
Changed 8 years ago by esaj
comment:5 Changed 8 years ago by esaj
- Summary changed from PREPEND_WWW setting doesn't work with flatpages middleware to PREPEND_WWW and APPEND_SLASH settings don't work with flatpages middleware
comment:13 follow-up: ↓ 19 Changed 7 years ago by jacob
- Resolution set to fixed
- Status changed from new to closed
comment:15 Changed 7 years ago by esaj
- Resolution fixed deleted
- Status changed from closed to reopened
comment:24 Changed 4 years ago by anonymous
- Owner changed from nobody to sswang
- Status changed from reopened to new