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

Changeset 1516

Show
Ignore:
Timestamp:
12/11/06 13:28:52
Author:
fumanchu
Message:

2.x backport of [1369]; new Request.is_index attribute is None until set to True or False by mapPathToObject.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/cherrypy-2.x/cherrypy/_cphttptools.py

    r1506 r1516  
    1515class Request(object): 
    1616    """An HTTP request.""" 
     17     
     18    is_index = None 
    1719     
    1820    def __init__(self, remoteAddr, remotePort, remoteHost, scheme="http"): 
     
    296298            defhandler = getattr(candidate, "default", None) 
    297299            if callable(defhandler) and getattr(defhandler, 'exposed', False): 
     300                # See http://www.cherrypy.org/ticket/613 
     301                self.is_index = objectpath.endswith("/") 
    298302                return defhandler, names[:i+1] + ["default"], names[i+1:-1] 
    299303             
     
    306310                    # We found the extra ".index". Check if the original path 
    307311                    # had a trailing slash (otherwise, do a redirect). 
     312                    self.is_index = True 
    308313                    if not objectpath.endswith('/'): 
    309314                        atoms = self.browser_url.split("?", 1) 
     
    312317                            newUrl += "?" + atoms[0] 
    313318                        raise cherrypy.HTTPRedirect(newUrl) 
     319                self.is_index = False 
    314320                return candidate, names[:i+1], names[i+1:-1] 
    315321             

Hosted by WebFaction

Log in as guest/cpguest to create tickets