Opened 4 years ago

Last modified 4 years ago

#32005 closed New feature

Allow disabling of auto-404-redirection in LocaleMiddleware — at Initial Version

Reported by: Alex Vandiver Owned by: nobody
Component: Internationalization Version: 3.1
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

This is related to the last two comments on #17734. Specifically, if an application decides to return an explicit 404, there is no way to prevent the LocaleMiddleware from overriding this and trying the language redirect.

In those comments, it was about catch-all URL patterns. I'm running into something related, but slightly different -- we [serve 404's for the / endpoint if the subdomain isn't valid](https://github.com/zulip/zulip/blob/master/zerver/middleware.py#L434), which the LocaleMiddleware unhelpfully redirects to (e.g.) /en/ which isn't any less of a 404.

Would folks be amenable to a patch which disabled the auto-404-redirect functionality in the middleware with a flag of some sort?

Change History (0)

Note: See TracTickets for help on using tickets.
Back to Top