diff options
author | Marcel Hellkamp <marc@gsites.de> | 2011-05-13 22:24:03 +0200 |
---|---|---|
committer | Marcel Hellkamp <marc@gsites.de> | 2011-05-13 22:24:03 +0200 |
commit | 9d60b6e13f23615dd07f463f6dba17a440139000 (patch) | |
tree | b8e6eb9ea953cfe20c3e1f6f203a2603814eef24 /test/test_environ.py | |
parent | b266125678d01bd49cea57fb225df1933351c479 (diff) | |
download | bottle-9d60b6e13f23615dd07f463f6dba17a440139000.tar.gz |
fix: "SERVER_NAME is substituted for '127.0.0.1' for relative redirects" issue #159
SERVER_NAME is only required for HTTP/1.0 clients that do not define a HTTP_HOST header. The HOST header, if present, should be correct.
Diffstat (limited to 'test/test_environ.py')
-rwxr-xr-x | test/test_environ.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/test/test_environ.py b/test/test_environ.py index 3612027..f917e70 100755 --- a/test/test_environ.py +++ b/test/test_environ.py @@ -242,6 +242,8 @@ class TestResponse(unittest.TestCase): if name.title() == 'Set-Cookie'] self.assertTrue('name=;' in cookies[0]) + + class TestRedirect(unittest.TestCase): def assertRedirect(self, target, result, query=None, status=303, **args): @@ -251,7 +253,6 @@ class TestRedirect(unittest.TestCase): args[key.replace('_', '.', 1)] = args[key] del args[key] env.update(args) - wsgiref.util.setup_testing_defaults(env) request.bind(env) try: bottle.redirect(target, **(query or {})) @@ -313,8 +314,6 @@ class TestRedirect(unittest.TestCase): HTTP_X_FORWARDED_HOST='example.com') self.assertRedirect('./test.html', 'http://example.com/test.html', SERVER_NAME='example.com') - self.assertRedirect('./test.html', 'http://example.com/test.html', - HTTP_HOST='example.com:80') self.assertRedirect('./test.html', 'http://example.com:81/test.html', HTTP_HOST='example.com:81') self.assertRedirect('./test.html', 'http://127.0.0.1:81/test.html', |