MCPcopy
hub / github.com/encode/httpx / test_same_origin

Function test_same_origin

tests/client/test_headers.py:240–247  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

238
239
240def test_same_origin():
241 origin = httpx.URL("https://example.com")
242 request = httpx.Request("GET", "HTTPS://EXAMPLE.COM:443")
243
244 client = httpx.Client()
245 headers = client._redirect_headers(request, origin, "GET")
246
247 assert headers["Host"] == request.url.netloc.decode("ascii")
248
249
250def test_not_same_origin():

Callers

nothing calls this directly

Calls 2

_redirect_headersMethod · 0.80
decodeMethod · 0.45

Tested by

no test coverage detected