Previously, a theme prefix of /Site/ would not match /Site. This is now
fixed.
called. Instead, we define a Theme function that calls the proper
constructor.
"""
called. Instead, we define a Theme function that calls the proper
constructor.
"""
+ path = context.request.path
+ # Always add a trailing space, so that a /Foo/ also matches the /Foo
+ # path (without needing to remove the trailing space from the
+ # prefix, which would make also match /FooBar).
+ if path[-1] != '/':
+ path += '/'
for (prefix, theme) in context.cfg.proxy_theme_mapping:
for (prefix, theme) in context.cfg.proxy_theme_mapping:
- if context.request.path.startswith(prefix):
+ if path.startswith(prefix):
return load_theme(context, theme)
raise ThemeNotFound("proxy_theme_mapping defines no theme for url: %s" % (context.request.path))
return load_theme(context, theme)
raise ThemeNotFound("proxy_theme_mapping defines no theme for url: %s" % (context.request.path))