#uri().host() works on https but not on http

1 messages · Page 1 of 1 (latest)

pure yoke
#

Hey im using _req.uri().host().unwrap_or("localhost").to_owned() to get the hostname the user is trying to connect to, however on http it always returns localhost, while on https it works without any issues.

pure yoke
#
            let host = headers.get("Host").unwrap().to_str().unwrap();

seems to work

pure yoke
simple vortex
#

http2 doesn't use Host headers