Exemple #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"
Exemple #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')
Exemple #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'
Exemple #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'
Exemple #7
0
def test_get_host_http_host():
    result = get_host({"HTTP_HOST": "example.com"})
    assert result == "example.com"
Exemple #8
0
def test_get_host_http_x_forwarded_host():
    result = get_host({"HTTP_X_FORWARDED_HOST": "example.com"})
    assert result == "example.com"
Exemple #9
0
 def test_http_host(self):
     result = get_host({'HTTP_HOST': 'example.com'})
     self.assertEquals(result, 'example.com')
Exemple #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'