Skip to content

Add support for X-Forwarded-For header as typed header #104

Closed

Description

@coderabbitai

Description

Add support for the X-Forwarded-For header as a typed header, similar to the recently added Forwarded header support.

Background

The X-Forwarded-For (XFF) header is a non-standard but widely used HTTP header that identifies the originating IP address of a client connecting through a proxy or load balancer. While the standardized Forwarded header (RFC 7239) has been implemented in PR #101, X-Forwarded-For remains widely deployed and should be supported as a typed header.

Header Format

The X-Forwarded-For header contains a comma-separated list of IP addresses:

X-Forwarded-For: client, proxy1, proxy2
X-Forwarded-For: 203.0.113.195, 70.41.3.18, 150.172.238.178

Implementation Requirements

  • Create a typed header class for parsing and representing X-Forwarded-For values
  • Support IPv4 and IPv6 addresses
  • Handle comma-separated lists of addresses
  • Integrate with the existing header framework (accessor, extensions)
  • Add comprehensive unit tests

Related

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions