Files
Dylan M. Taylor 3d75db28e3 fix: parse Forwarded for= nodes and match disabled endpoints on the routed path (#322)
What was wrong: (1) the Forwarded fallback returned the whole first list
element (e.g. `for=1.2.3.4;proto=http`), so exact IP bans never matched.
(2) The disabled-endpoint filter compared the raw URI path while actix
routes on the percent-decoded path, so an equivalent encoded spelling
bypassed it.

Change: Forwarded values are parsed per RFC 7239 (first for= node,
quotes/brackets/port stripped); X-Forwarded-For is unchanged. The filter
now checks request.match_info().as_str(), the path actix routes with.

Blast radius: crates/lib/actix_helpers (ban filter and disabled-endpoint
middleware).

Behavior changes: requests using a Forwarded header now yield a bare IP;
encoded spellings of a disabled path are now blocked.

Checks run: cargo test -p actix_helpers (new Forwarded test).
Checks not run: clippy -D warnings (91 pre-existing errors in this crate
on main); no integration test of the middleware against an encoded URI.


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **Bug Fixes**
* Forwarded IP addresses are now read from the first `for` parameter,
including quoted values and IPv6 addresses. Other supported IP headers
retain their existing parsing behavior.
* Disabled-endpoint checks now use the matched route rather than the raw
request path, improving checks for requests handled through routed
endpoints.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-11 12:03:28 -05:00
..
2026-05-08 12:49:15 -04:00
2026-09-12 12:23:46 -04:00