rawhat / mist

gleam HTTP server. because it glistens on a web
Apache License 2.0
333 stars 12 forks source link

request does not take host (and port) from header #37

Closed keroami closed 9 months ago

keroami commented 9 months ago

Header host: 127.0.0.1:8888 request host will be localhost (default value?) instead of 127.0.0.1, port None instead of Some(8888).

This makes it impossible to let mist serve multiple hosts / DNS names, as it is impossible to pattern match on the host, like it is for path_segments.

mist 0.17.0

rawhat commented 9 months ago

I can pull those values out of the host header field and put them into the constructed request.

For now, you can grab them from the headers as request.get_header(req, "host").

rawhat commented 9 months ago

This should be resolved on master. If you wanna try it out with a path dependency and let me know if it works well for you, I can push out a minor version soon.

Otherwise I can just publish it tomorrow anyway.

Thanks!

keroami commented 9 months ago

tried with path dep. works fine! Thx!