In summary, applies the proposed strip -> rstrip modification to route_prefix handling such that the resulting route_prefix in the configurator keeps the leading / if explicitly specified. If not specified (i.e.: route_prefix="prefix" instead of route_prefix="/prefix"), it results in the same behavior as before.
When merging/nesting multiple paths/routes onto each other, insertion of the / is applied automatically as needed (as it was before, but considering /prefix must be kept instead of prefix).
Added exhaustive test combinations for combining config.include(route_prefix=...), with config.route_prefix_context(route_prefix=...) with direct/nested configurators and with/without explicit leading slash.
Fixes https://github.com/Pylons/pyramid/issues/3758
In summary, applies the proposed
strip
->rstrip
modification toroute_prefix
handling such that the resultingroute_prefix
in the configurator keeps the leading/
if explicitly specified. If not specified (i.e.:route_prefix="prefix"
instead ofroute_prefix="/prefix"
), it results in the same behavior as before.When merging/nesting multiple paths/routes onto each other, insertion of the
/
is applied automatically as needed (as it was before, but considering/prefix
must be kept instead ofprefix
).Added exhaustive test combinations for combining
config.include(route_prefix=...)
,with config.route_prefix_context(route_prefix=...)
with direct/nested configurators and with/without explicit leading slash.