rawhat / mist

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

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

Closed keroami closed 5 months ago

keroami commented 5 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 5 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 5 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 5 months ago

tried with path dep. works fine! Thx!