Changeset 5156

Show
Ignore:
Timestamp:
08/18/08 15:29:58 (5 months ago)
Author:
chrisz
Message:

Some amendments of r5145 (#1606, #1939).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.0/turbogears/qstemplates/quickstartbig/+package+/controllers/root.py_tmpl

    r4334 r5156  
    3030 
    3131        forward_url = None 
    32         previous_url = request.path 
     32        previous_url = request.object_path 
    3333 
    3434        if identity.was_login_attempted(): 
  • branches/1.0/turbogears/qstemplates/quickstart/+package+/controllers.py_tmpl

    r4334 r5156  
    3030 
    3131        forward_url = None 
    32         previous_url = request.path 
     32        previous_url = request.object_path 
    3333 
    3434        if identity.was_login_attempted(): 
  • branches/1.0/turbogears/startup.py

    r5145 r5156  
    150150                request.object_path = path[len(webpath):] 
    151151            elif not request.path.startswith(webpath): 
    152                 raise cherrypy.NotFound(path) 
     152                # check for webpath only if not forwarded 
     153                try: 
     154                    if not request.wsgi_environ['HTTP_X_FORWARDED_SERVER']: 
     155                        raise KeyError 
     156                except (AttributeError, KeyError): 
     157                    raise cherrypy.NotFound(path) 
    153158 
    154159 
  • branches/1.1/turbogears/qstemplates/quickstartbig/+package+/controllers/root.py_tmpl

    r4363 r5156  
    3030 
    3131        forward_url = None 
    32         previous_url = request.path 
     32        previous_url = request.object_path 
    3333 
    3434        if identity.was_login_attempted(): 
  • branches/1.1/turbogears/qstemplates/quickstart/+package+/controllers.py_tmpl

    r4363 r5156  
    3030 
    3131        forward_url = None 
    32         previous_url = request.path 
     32        previous_url = request.object_path 
    3333 
    3434        if identity.was_login_attempted(): 
  • branches/1.1/turbogears/startup.py

    r5145 r5156  
    149149            elif path.startswith(webpath): 
    150150                request.object_path = path[len(webpath):] 
    151             elif not request.path.startswith(webpath): 
     151        elif not request.path.startswith(webpath): 
     152            # check for webpath only if not forwarded 
     153            try: 
     154                if not request.wsgi_environ['HTTP_X_FORWARDED_SERVER']: 
     155                    raise KeyError 
     156            except (AttributeError, KeyError): 
    152157                raise cherrypy.NotFound(path) 
    153158 
  • branches/1.5/turbogears/tests/test_controllers.py

    r5145 r5156  
    590590    def test_approots(self): 
    591591        response = self.app.get("/subthing/", status=200) 
    592         # TODO: this works in 1.1, broken in 1.5 
     592        # TODO: this works in 1.0 and 1.1, broken in 1.5 
     593        # (probably because of check_app_root was removed in r5019) 
    593594        # assert "/subthing/foo" in response 
    594595        response = self.app.get("/nosubthing/", status=404) 
     
    597598    def test_lower_approots(self): 
    598599        response = self.app.get("/subthing/subsubthing/") 
    599         # TODO: this works in 1.1, broken in 1.5 
     600        # TODO: this works in 1.0 and 1.1, broken in 1.5 
    600601        # assert "/subthing/subsubthing/foo" in response 
    601602 
     
    603604        config.update({"server.webpath": "/coolsite/root"}) 
    604605        response = self.app.get("/subthing/") 
    605         # TODO: this works in 1.1, broken in 1.5 
     606        # TODO: this works in 1.0 and 1.1, broken in 1.5 
    606607        # assert "/coolsite/root/subthing/foo" in response 
    607608