Files
hermes-agent/hermes_cli/proxy
kshitijk4poor 98f7ec3cf4 refactor(proxy): derive the bind policy once and pin the refusal status
The bind address never changes for an app's lifetime, so create_app now
canonicalises it and computes the wildcard flag and allowed Host set once
instead of on every request. _WILDCARD_HOSTS duplicated what
ip_address().is_unspecified already answers (only "" needs a special case),
the Sec-Fetch-Site sets become named module constants, and fetch_site is a
required argument so no caller can silently skip that check.

The 403 message now says what is actually refused (browser requests and
foreign Host names) rather than implying every non-local client is.

The parametrized proxy test asserted 200-vs-"some 4xx" via a tuple
comparison; it now pins status == 200/403 and the exact upstream request
count, so a regression to a different status or a leaked forward fails.
2026-10-03 16:29:17 +05:30
..