You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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/.
The text was updated successfully, but these errors were encountered:
In
redirect
, the default value forlocale_prefix
isTrue
. 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 toFalse
inredirect
, 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/
.The text was updated successfully, but these errors were encountered: