Download Install Tutorial Docs FAQ Tools WikiLicense Team IRC Planet Involvement Shop Book

Ticket #363 (defect)

Opened 3 years ago

Last modified 3 years ago

Request-URI of * needs better API

Status: closed (fixed)

Reported by: fumanchu Assigned to: fumanchu
Priority: normal Milestone: 2.2-beta
Component: CherryPy code Keywords:
Cc:

Changeset [523] introduced a way to map a Request-URI of "*" (no resource) to cherrypy.root._global. See http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.2 for the rare case where anyone would send such a request.

cherrypy.root._global isn't the best solution for two reasons:

  1. The name is wrong. It shouldn't be _global, but global or __global__ or something else instead. The leading-single-underscore is the wrong semantic (there's no reason it should be a loosely-private name). It was chosen too quickly, in order to minimize collisions with user code.
  2. The slot is wrong. It shouldn't be under cherrypy.root. Instead, it should be under cherrypy or even cherrypy.server. Possible names would be cherrypy.no_resource() or cherrypy.server.global(). You might think (as I did when I made the change) that cherrypy.root is the more correct place for this, since cherrypy.root is where even a Request-URI of "/" is mapped. However, we should, in the future, move to arbitrary mount points for applications (where cherrypy.root.index actually maps to a URI like /my/corner/of/this/website/blog/). When we do, it won't work to map "*" to cherrypy.root, since we will potentially have multiple such root objects; the "*" URI cannot be subject to a mount point like "/" can be.

Change History

11/01/05 15:22:48: Modified by fumanchu

  • status changed from new to closed.
  • resolution set to fixed.

Fixed in [777].

Hosted by WebFaction

Log in as guest/cpguest to create tickets