Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strip non-address characters from Forwarded for= #3343

Merged
merged 4 commits into from
Jun 9, 2024

Conversation

mpalmer
Copy link
Contributor

@mpalmer mpalmer commented Apr 26, 2024

PR Type

Bug Fix

PR Checklist

  • Tests for the changes have been added / updated.
  • Documentation comments have been added / updated.
  • A changelog entry has been made for the appropriate packages.
  • Format code with the latest stable rustfmt.
  • (Team) Label with affected crates and semver status.

Overview

This is something of a followup to #2528, which asked for port information to not be included in when it was taken from the local socket.

The header's element may optionally contain port information (https://datatracker.ietf.org/doc/html/rfc7239#section-6). However, as I understand it, is supposed to only contain an IP address, without port (per #2528).

This PR corrects that discrepancy, making it easier to parse the result of this method in application code.

There should not be any compatibility concerns, as anyone parsing the output of would already need to handle both port and portless cases anyway.

This is something of a followup to actix#2528, which asked for port information to not be included in  when it was taken from the local socket.

The  header's  element may optionally contain port information (https://datatracker.ietf.org/doc/html/rfc7239#section-6).
However, as I understand it,  is *supposed* to only contain an IP address, without port (per actix#2528).

This PR corrects that discrepancy, making it easier to parse the result of this method in application code.

There should not be any compatibility concerns, as anyone parsing the output of  would already need to handle both port and portless cases anyway.
@robjtede robjtede enabled auto-merge June 9, 2024 23:30
@robjtede
Copy link
Member

robjtede commented Jun 9, 2024

LGTM, the prevalence (or lack thereof) of IPv6 makes this change low risk.

@robjtede robjtede added this pull request to the merge queue Jun 9, 2024
Merged via the queue into actix:master with commit a2b9823 Jun 9, 2024
12 of 13 checks passed
@mpalmer mpalmer deleted the forwarded-strip-port branch June 10, 2024 22:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-web project: actix-web B-semver-patch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants