MCPcopy
hub / github.com/pallets/werkzeug / _matches_request

Method _matches_request

src/werkzeug/test.py:1411–1425  ·  view source on GitHub ↗
(self, server_name: str, path: str)

Source from the content-addressed store, hash-verified

1409 """The ``SameSite`` parameter."""
1410
1411 def _matches_request(self, server_name: str, path: str) -> bool:
1412 return (
1413 server_name == self.domain
1414 or (
1415 not self.origin_only
1416 and server_name.endswith(self.domain)
1417 and server_name[: -len(self.domain)].endswith(".")
1418 )
1419 ) and (
1420 path == self.path
1421 or (
1422 path.startswith(self.path)
1423 and path[len(self.path) - self.path.endswith("/") :].startswith("/")
1424 )
1425 )
1426
1427 def _to_request_header(self) -> str:
1428 return f"{self.key}={self.value}"

Callers 1

_add_cookies_to_wsgiMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected