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

Ticket #249 (defect)

Opened 5 years ago

Last modified 5 years ago

Replace the built in expose decorator with ExposeAs

Status: closed (fixed)

Reported by: steadicat Assigned to: fumanchu
Priority: normal Milestone: 2.1-rc1
Component: CherryPy code Keywords: exposed
Cc: cherrypy@attardi.org

Replace the built in @cherrypy.expose decorator with ExposeAs?, as was once agreed upon.

ExposeAs? solves the many cases where an url is not made up of valid Python identifiers:

  • Urls with file extensions ("favicon.ico", "default.css", "ajax.js"...): ExposeAs? is a cleaner fix for #87
  • Python reserved words ("class", "print", "exec"...): see this thread
  • Urls with spaces or other special characters ("résumé"...) which are explicitly allowed in the HTML spec: see #104

Note that the code contains a one-line hack to reverse the change that was done to fix #87. #87 should be reversed and the hack removed.

This change is also related to #248. If #248 is fixed the method lookup function should UTF-8 encode the url bits before looking up the attributes of the exposed objects. In this case the "Firefox hack" should also be removed and moved into the DecodingFilter? if necessary.

Change History

08/02/05 12:48:29: Modified by steadicat

  • description changed.

09/05/05 06:22:35: Modified by rdelon

  • milestone changed from 2.1 to 2.1-final.

09/05/05 06:25:14: Modified by rdelon

  • milestone changed from 2.1-final to 2.1-rc1.

09/08/05 13:22:15: Modified by rdelon

  • owner changed from rdelon to fumanchu.

09/09/05 18:25:58: Modified by fumanchu

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

Implemented in changeset [620].

Hosted by WebFaction

Log in as guest/cpguest to create tickets