1. cherrypy
  2. CherryPy
Issue #737 resolved

It's not possible to have custom request handler on application mount point

Lukas Linhart
created an issue

I have one application at /, second at /app. I'd like app to attach dispatcher to both / and /app, which will redirect request with certain headers to /app/index and handling rest normally.

Problem is, that clients are asking for /app?s=blahblah (and I cannot change it), instead of /app/?s=blahblah. Application at mount point / app is recognized (thus dipatcher on / has no effect), and thus path_info is empty string. Thus, request.get_resource() has no chance for loading proper dispatcher (because of while path_info chunk).

Quick hack is to add

if not trail: tail = '/'

before while cycle. This allows root dispatcher to be resolved.

Comments (3)

  1. Log in to comment