Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In redirect, change locale_prefix default to False #1

Open
jwhitlock opened this issue Jul 28, 2017 · 0 comments
Open

In redirect, change locale_prefix default to False #1

jwhitlock opened this issue Jul 28, 2017 · 0 comments

Comments

@jwhitlock
Copy link

In redirect, the default value for locale_prefix is True. This expects that a URL will have an optional locale prefix, such as /en-US/the/page, and that the locale should be automatically pre-pended to the resulting redirect pattern. This is probably the right default for many Mozilla projects, including Bedrock and Kuma, but not in a general redirect library.

One solution would be to make locale_prefix default to False in redirect, and add a wrapper functionlocale_redirect that has the old default. This could grow an optional validation routine, for example you could pass a list of expected locales, and if the prefix doesn't match, it could not be treated as a locale. This would avoid treating paths like /foo/bar as locale=foo/.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant