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

Changeset 1657

Show
Ignore:
Timestamp:
05/30/07 18:54:09
Author:
fumanchu
Message:

RFC 2606 updates (official example domains).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/cherrypy/__init__.py

    r1656 r1657  
    213213        This should start with a slash, and be the path portion of the URL 
    214214        at which to mount the given root. For example, if root.index() will 
    215         handle requests to "http://host.domain.tld:8080/dept/app1/", then 
     215        handle requests to "http://www.example.com:8080/dept/app1/", then 
    216216        the script_name argument would be "/dept/app1". 
    217217    config: a file or dict containing application config. If this contains 
  • trunk/cherrypy/_cpdispatch.py

    r1656 r1657  
    351351    website structure. For example: 
    352352     
    353         http://www.mydom1.com  ->  root 
    354         http://www.mydom2.com  ->  root/mydom2/ 
    355         http://www.mydom2.com:443  ->  root/secure 
     353        http://www.domain.example  ->  root 
     354        http://www.domain2.example  ->  root/domain2/ 
     355        http://www.domain2.example:443  ->  root/secure 
    356356     
    357357    can be accomplished via the following config: 
     
    359359        [/] 
    360360        request.dispatch = cherrypy.dispatch.VirtualHost( 
    361             **{'www.mydom2.com': '/mydom2', 
    362                'www.mydom2.com:443': '/secure', 
     361            **{'www.domain2.example': '/domain2', 
     362               'www.domain2.example:443': '/secure', 
    363363              }) 
    364364     
     
    376376        value will be prepended to the URL path before calling the 
    377377        next dispatcher. Note that you often need separate entries 
    378         for "mysite.com" and "www.mysite.com". In addition, "Host" 
     378        for "example.com" and "www.example.com". In addition, "Host" 
    379379        headers may contain the port number. 
    380380    """ 
  • trunk/cherrypy/_cperror.py

    r1617 r1657  
    5757        for url in urls: 
    5858            # Note that urljoin will "do the right thing" whether url is: 
    59             #  1. a complete URL with host (e.g. "http://www.dummy.biz/test") 
     59            #  1. a complete URL with host (e.g. "http://www.example.com/test") 
    6060            #  2. a URL relative to root (e.g. "/dummy") 
    6161            #  3. a URL relative to the current path 
     
    215215 
    216216 
    217 _HTTPErrorTemplate = '''<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
     217_HTTPErrorTemplate = '''<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
     218"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
    218219<html> 
    219220<head> 
  • trunk/cherrypy/_cptree.py

    r1656 r1657  
    5757    script_name__doc = """ 
    5858    The URI "mount point" for this app; for example, if script_name is 
    59     "/my/cool/app", then the URL "http://my.domain.tld/my/cool/app/page1" 
     59    "/my/cool/app", then the URL "http://www.example.com/my/cool/app/page1" 
    6060    might be handled by a "page1" method on the root object. If script_name 
    6161    is explicitly set to None, then the script_name will be provided 
     
    136136            This should start with a slash, and be the path portion of the 
    137137            URL at which to mount the given root. For example, if root.index() 
    138             will handle requests to "http://host.domain.tld:8080/dept/app1/", 
     138            will handle requests to "http://www.example.com:8080/dept/app1/", 
    139139            then the script_name argument would be "/dept/app1". 
    140140        config: a file or dict containing application config. 
  • trunk/cherrypy/test/test_misc_tools.py

    r1422 r1657  
    5757     
    5858    conf = {'/referer': {'tools.referer.on': True, 
    59                          'tools.referer.pattern': r'http://[^/]*thisdomain\.com', 
     59                         'tools.referer.pattern': r'http://[^/]*example\.com', 
    6060                         }, 
    6161            '/referer/reject': {'tools.referer.accept': False, 
     
    9393         
    9494        self.getPage('/referer/accept', 
    95                      headers=[('Referer', 'http://www.thisdomain.com/')]) 
     95                     headers=[('Referer', 'http://www.example.com/')]) 
    9696        self.assertStatus(200) 
    9797        self.assertBody('Accepted!') 
     
    103103         
    104104        self.getPage('/referer/reject', 
    105                      headers=[('Referer', 'http://www.thisdomain.com/')]) 
     105                     headers=[('Referer', 'http://www.example.com/')]) 
    106106        self.assertErrorPage(403, 'Forbidden Referer header.') 
    107107 
  • trunk/cherrypy/test/test_proxy.py

    r1528 r1657  
    5353         
    5454        # Test X-Forwarded-Host (Apache 1.3.33+ and Apache 2) 
    55         self.getPage("/", headers=[('X-Forwarded-Host', 'http://www.yetanother.com')]) 
    56         self.assertHeader('Location', "http://www.yetanother.com/dummy") 
    57         self.getPage("/", headers=[('X-Forwarded-Host', 'www.yetanother.com')]) 
    58         self.assertHeader('Location', "%s://www.yetanother.com/dummy" % self.scheme) 
     55        self.getPage("/", headers=[('X-Forwarded-Host', 'http://www.example.com')]) 
     56        self.assertHeader('Location', "http://www.example.com/dummy") 
     57        self.getPage("/", headers=[('X-Forwarded-Host', 'www.example.com')]) 
     58        self.assertHeader('Location', "%s://www.example.com/dummy" % self.scheme) 
    5959         
    6060        # Test X-Forwarded-For (Apache2) 
     
    6767         
    6868        # Test X-Host (lighttpd; see https://trac.lighttpd.net/trac/ticket/418) 
    69         self.getPage("/xhost", headers=[('X-Host', 'www.yetanother.com')]) 
    70         self.assertHeader('Location', "%s://www.yetanother.com/blah" % self.scheme) 
     69        self.getPage("/xhost", headers=[('X-Host', 'www.example.com')]) 
     70        self.assertHeader('Location', "%s://www.example.com/blah" % self.scheme) 
    7171         
    7272        # Test X-Forwarded-Proto (lighttpd) 
     
    8181                            + sn + "/this/new/page'>this page</a>.") 
    8282            self.getPage(sn + "/newurl", headers=[('X-Forwarded-Host', 
    83                                                    'http://www.yetanother.com')]) 
    84             self.assertBody("Browse to <a href='http://www.yetanother.com" 
     83                                                   'http://www.example.com')]) 
     84            self.assertBody("Browse to <a href='http://www.example.com" 
    8585                            + sn + "/this/new/page'>this page</a>.") 
    8686             
     
    100100         
    101101        # Test trailing slash (see http://www.cherrypy.org/ticket/562). 
    102         self.getPage("/xhost/", headers=[('X-Host', 'www.yetanother.com')]) 
    103         self.assertHeader('Location', "%s://www.yetanother.com/xhost" 
     102        self.getPage("/xhost/", headers=[('X-Host', 'www.example.com')]) 
     103        self.assertHeader('Location', "%s://www.example.com/xhost" 
    104104                          % self.scheme) 
    105105 

Hosted by WebFaction

Log in as guest/cpguest to create tickets