-
-
Notifications
You must be signed in to change notification settings - Fork 159
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
Error: undefined method 'address' for Socket::UNIXAddress (compile-time type is Socket::Address+) #1643
Labels
Comments
Yeah, I feel like we should be able to update the handler to better handle this. You shouldn't have to do all the guessing and stuff with it lucky/src/lucky/remote_ip_handler.cr Lines 10 to 32 in 08a70e1
|
jwoertink
added a commit
that referenced
this issue
Feb 19, 2022
… name where the IP value comes from. Added new remote_ip method to give you access to the raw string. Fixes #1643
jwoertink
added a commit
that referenced
this issue
Mar 7, 2022
* Updating RemoteIpHandler to now include habitat config for the header name where the IP value comes from. Added new remote_ip method to give you access to the raw string. Fixes #1643 * Updating so there's only 1 header to check. Now using the last IP in the header list as per the linked article in the comments.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
Type mismatch for
Socket::UNIXAddress
To Reproduce
ip_address = context.request.remote_address.try(&.address) || "N/A"
from https://luckyframework.org/guides/http-and-routing/http-handlers#remoteiphandler
Screenshots/code
Fix
ip_address = context.request.remote_address.as(Socket::IPAddress).try(&.address) || "N/A"
Versions (please complete the following information):
The text was updated successfully, but these errors were encountered: