Esempio n. 1
0
def test_get_host_http_strips_port():
    result = get_host({
        "wsgi.url_scheme": "http",
        "SERVER_NAME": "example.com",
        "SERVER_PORT": "80"
    })
    assert result == "example.com"
Esempio n. 2
0
 def test_http_nonstandard_port(self):
     result = get_host({
         'wsgi.url_scheme': 'http',
         'SERVER_NAME': 'example.com',
         'SERVER_PORT': '81',
     })
     self.assertEquals(result, 'example.com:81')
Esempio n. 3
0
def test_get_host_http_nonstandard_port():
    result = get_host({
        "wsgi.url_scheme": "http",
        "SERVER_NAME": "example.com",
        "SERVER_PORT": "81"
    })
    assert result == "example.com:81"
def test_get_host_http_nonstandard_port():
    result = get_host({
        'wsgi.url_scheme': 'http',
        'SERVER_NAME': 'example.com',
        'SERVER_PORT': '81',
    })
    assert result == 'example.com:81'
Esempio n. 5
0
 def test_https_strips_port(self):
     result = get_host({
         'wsgi.url_scheme': 'https',
         'SERVER_NAME': 'example.com',
         'SERVER_PORT': '443',
     })
     self.assertEquals(result, 'example.com')
def test_get_host_https_strips_port():
    result = get_host({
        'wsgi.url_scheme': 'https',
        'SERVER_NAME': 'example.com',
        'SERVER_PORT': '443',
    })
    assert result == 'example.com'
Esempio n. 7
0
def test_get_host_http_host():
    result = get_host({"HTTP_HOST": "example.com"})
    assert result == "example.com"
Esempio n. 8
0
def test_get_host_http_x_forwarded_host():
    result = get_host({"HTTP_X_FORWARDED_HOST": "example.com"})
    assert result == "example.com"
Esempio n. 9
0
 def test_http_host(self):
     result = get_host({'HTTP_HOST': 'example.com'})
     self.assertEquals(result, 'example.com')
Esempio n. 10
0
 def test_http_x_forwarded_host(self):
     result = get_host({'HTTP_X_FORWARDED_HOST': 'example.com'})
     self.assertEquals(result, 'example.com')
def test_get_host_http_host():
    result = get_host({'HTTP_HOST': 'example.com'})
    assert result == 'example.com'
def test_get_host_http_x_forwarded_host():
    result = get_host({'HTTP_X_FORWARDED_HOST': 'example.com'})
    assert result == 'example.com'