-
-
Notifications
You must be signed in to change notification settings - Fork 206
Use get_peer_data
function
#273
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
Use get_peer_data
function
#273
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for opening this!
I'll probably hold off on merging this until after I do another release as restricting to these versions of Plug may have an impact on existing users.
mix.exs
Outdated
{:uuid, "~> 1.0"}, | ||
{:poison, "~> 1.5 or ~> 2.0 or ~> 3.0"}, | ||
{:plug, "~> 1.0", optional: true}, | ||
{:plug, ">= 1.6.0 and < 2.0.0", optional: true}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you change this to ~> 1.6
? I think that would be equivalent to the above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought ~> 1.6
meant ">= 1.6 and < 1.7" but that's incorrect. I'll address it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All good, thanks for addressing it!
If it's helpful, https://hexdocs.pm/elixir/Version.html has an explanation of the version locking rules
@tt Thanks again for opening this PR! 💖 💖 💖 💖 |
@mitchellhenke I don't think the library should use the peer's port as the remote port. With today's architectures this is often going to be wrong. Might be best to skip it. |
@stevedomin This is an area I'm not overly familiar with, so if you don't mind I have a few questions. Is there something that would be more correct? Or it's not feasible to do that, and the current port information isn't super valuable, and should be removed? Any links to information on the topic would also be greatly appreciated if that exists. 🙂 |
@mitchellhenke sure. If your application is behind a load-balancer/proxy the Despite this I still think it might be best to remove it completely. It's not going to be set often enough that it is useful and having the peer port is not super valuable. |
In elixir-plug/plug@d24ba4f, the
peer
field got replaced with aget_peer_data
function.This makes the package require Plug 1.6.0 and uses this new function to resolve the remote port.