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

improve remote_addr behavior #2653

Closed
wants to merge 5 commits into from
Closed

Conversation

Roguelazer
Copy link
Contributor

Closes #2652

Description

See #2652 for details; this makes two changes:

  • When using the set_remote_address header: "header_name" functionality, if the header is not passed, REMOTE_ADDR is now set to the physical peeraddr instead of always being set to 127.0.0.1
  • When an error occurs preventing the physical peeraddr from being fetched, REMOTE_ADDR is now set to the unspecified source address ('0.0.0.0') instead of to '127.0.0.1'

Your checklist for this pull request

  • I have reviewed the guidelines for contributing to this repository.
  • I have added (or updated) appropriate tests if this PR fixes a bug or adds a feature.
  • My pull request is 100 lines added/removed or less so that it can be easily reviewed.
  • If this PR doesn't need tests (docs change), I added [ci skip] to the title of the PR.
  • If this closes any issues, I have added "Closes #issue" to the PR description or my commit messages.
  • I have updated the documentation accordingly.
  • All new and existing tests passed, including Rubocop.

@nateberkopec nateberkopec added feature waiting-for-review Waiting on review from anyone labels Jul 5, 2021
@nateberkopec nateberkopec added this to the 6.0.0 milestone Jul 5, 2021
@nateberkopec nateberkopec removed the waiting-for-review Waiting on review from anyone label Jul 5, 2021
lib/puma/const.rb Outdated Show resolved Hide resolved
@nateberkopec
Copy link
Member

Had a think about it and I think both of these changes are an improvement. However, they both have the potential to break people's setups, so I think we need to park these until 6.0.

Your other option is to put one or both changes behind a temporary config option that we will remove in 6.0.

I don't have a lot of insight right now on whether or not the next release will be a minor or major, so no promises on how long this could stay parked.

Had one small concern about ipv6, see comment.

@nateberkopec nateberkopec added waiting-for-review Waiting on review from anyone and removed waiting-for-review Waiting on review from anyone labels Aug 12, 2021
@nateberkopec
Copy link
Member

Removed waiting for review. This is only blocked on next major release.

@nateberkopec
Copy link
Member

I'm thinking next release might be a major.

@nateberkopec
Copy link
Member

Merged!

@dentarg
Copy link
Member

dentarg commented Mar 7, 2022

Why not squash merging @nateberkopec ?

@nateberkopec
Copy link
Member

Did it on the CLI and forgot 😆

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When remote_addr_header is used, but not passed, remote_addr defaults to localhost
3 participants