()
| 484 | |
| 485 | |
| 486 | def test_http_host_before_server_name(): |
| 487 | env = { |
| 488 | "HTTP_HOST": "wiki.example.com", |
| 489 | "SERVER_NAME": "web0.example.com", |
| 490 | "SERVER_PORT": "80", |
| 491 | "SCRIPT_NAME": "", |
| 492 | "PATH_INFO": "", |
| 493 | "REQUEST_METHOD": "GET", |
| 494 | "wsgi.url_scheme": "http", |
| 495 | } |
| 496 | map = r.Map([r.Rule("/", endpoint="index", subdomain="wiki")]) |
| 497 | adapter = map.bind_to_environ(env, server_name="example.com") |
| 498 | assert adapter.match("/") == ("index", {}) |
| 499 | assert adapter.build("index", force_external=True) == "http://wiki.example.com/" |
| 500 | assert adapter.build("index") == "/" |
| 501 | |
| 502 | env["HTTP_HOST"] = "admin.example.com" |
| 503 | adapter = map.bind_to_environ(env, server_name="example.com") |
| 504 | assert adapter.build("index") == "http://wiki.example.com/" |
| 505 | |
| 506 | |
| 507 | def test_invalid_subdomain_warning(): |
nothing calls this directly
no test coverage detected