Commits

Robert Brewer committed 2bf166e

Use sample domains in test.

Comments (0)

Files changed (1)

cherrypy/test/test_proxy.py

     cherrypy.config.update({
         'environment': 'test_suite',
         'tools.proxy.on': True,
-        'tools.proxy.base': 'www.mydomain.com',
+        'tools.proxy.base': 'www.mydomain.test',
         })
     
     # Set up application
     def testProxy(self):
         self.getPage("/")
         self.assertHeader('Location',
-                          "%s://www.mydomain.com%s/dummy" %
+                          "%s://www.mydomain.test%s/dummy" %
                           (self.scheme, self.prefix()))
         
         # Test X-Forwarded-Host (Apache 1.3.33+ and Apache 2)
-        self.getPage("/", headers=[('X-Forwarded-Host', 'http://www.example.com')])
-        self.assertHeader('Location', "http://www.example.com/dummy")
-        self.getPage("/", headers=[('X-Forwarded-Host', 'www.example.com')])
-        self.assertHeader('Location', "%s://www.example.com/dummy" % self.scheme)
+        self.getPage("/", headers=[('X-Forwarded-Host', 'http://www.example.test')])
+        self.assertHeader('Location', "http://www.example.test/dummy")
+        self.getPage("/", headers=[('X-Forwarded-Host', 'www.example.test')])
+        self.assertHeader('Location', "%s://www.example.test/dummy" % self.scheme)
         
         # Test X-Forwarded-For (Apache2)
         self.getPage("/remoteip",
         self.assertBody("192.168.0.20")
         
         # Test X-Host (lighttpd; see https://trac.lighttpd.net/trac/ticket/418)
-        self.getPage("/xhost", headers=[('X-Host', 'www.example.com')])
-        self.assertHeader('Location', "%s://www.example.com/blah" % self.scheme)
+        self.getPage("/xhost", headers=[('X-Host', 'www.example.test')])
+        self.assertHeader('Location', "%s://www.example.test/blah" % self.scheme)
         
         # Test X-Forwarded-Proto (lighttpd)
         self.getPage("/base", headers=[('X-Forwarded-Proto', 'https')])
-        self.assertBody("https://www.mydomain.com")
+        self.assertBody("https://www.mydomain.test")
         
         # Test cherrypy.url()
         for sn in script_names:
             # Test the value inside requests
             self.getPage(sn + "/newurl")
-            self.assertBody("Browse to <a href='%s://www.mydomain.com" % self.scheme
+            self.assertBody("Browse to <a href='%s://www.mydomain.test" % self.scheme
                             + sn + "/this/new/page'>this page</a>.")
             self.getPage(sn + "/newurl", headers=[('X-Forwarded-Host',
-                                                   'http://www.example.com')])
-            self.assertBody("Browse to <a href='http://www.example.com"
+                                                   'http://www.example.test')])
+            self.assertBody("Browse to <a href='http://www.example.test"
                             + sn + "/this/new/page'>this page</a>.")
             
             # Test the value outside requests
             self.assertBody(expected)
         
         # Test trailing slash (see http://www.cherrypy.org/ticket/562).
-        self.getPage("/xhost/", headers=[('X-Host', 'www.example.com')])
-        self.assertHeader('Location', "%s://www.example.com/xhost"
+        self.getPage("/xhost/", headers=[('X-Host', 'www.example.test')])
+        self.assertHeader('Location', "%s://www.example.test/xhost"
                           % self.scheme)
 
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.