-
Notifications
You must be signed in to change notification settings - Fork 38
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
request host, port, and scheme all missing when running localhost #83
Comments
Thanks, Alan! I asked him to open this here even though I think the underlying problem is likely in Erlang's packet parser since Elli just does:
So if Erlang packet parser is incorrectly returning But will need to verify this and could still be an Elli issue. |
Thanks! I can have a look sometime this week. |
Wishful thinking, it seems. Will try for this week. Feel free to beat me to it. |
For what it's worth, this appears to be related to the contents of the packet being passed back from the
if i manually modify the same packet to pre-pend the missing info to the path:
I tried to trace this back to the source but best I can tell, it appears to be coming from the C message responses generated in the |
Oh weird, thanks @jeffgrunewald I wonder if we are supposed to just infer "localhost" if nothing else is there. I was going to say the port could be taken from the socket itself but it should probably be the port in the URL and not the port being listened on, since those could technically be different. |
Where should we get the URL from if it's not able to be parsed from the packet? The |
FWIW, it looks like Cowboy attempts to get around this issue by primarily pulling the host from the clients’ |
Thanks @jeffgrunewald I opened a PR to have |
when implementing my handle function on localhost, I was hoping to be able to utilize
scheme
,host
, andport
. I keep gettingundefined
. I admittedly am not super slick with erlang, but the rest of the application works correctly (when gettingraw_path
, for example, everything is as expected).elli/src/elli_request.erl
Lines 62 to 67 in 21e2eeb
All are undefined when this runs inside my server (though
method
properly returns).result:
calling using
curl
:System specs:
MacOS Catalina, 10.15.4
Erlang installed using https://github.com/asdf-vm/asdf :
The text was updated successfully, but these errors were encountered: