When calling req.uri() from inside some middleware service the scheme and authority seems to be dropped from the ServiceRequest.
This code here checks for authority and scheme and throws an error if they're missing.
https://github.com/hlb8122/keyserver-rust/blob/8394043e801c090ff56e5048d69f39e8569c12ab/src/net/payments.rs#L253
Initializing a testing app like this:
https://github.com/hlb8122/keyserver-rust/blob/8394043e801c090ff56e5048d69f39e8569c12ab/src/net/payments.rs#L451
passes the the check above.
However initializing the app like this:
https://github.com/hlb8122/keyserver-rust/blob/8394043e801c090ff56e5048d69f39e8569c12ab/src/main.rs#L78
fails the check above?
I'm unsure whether the the authority and scheme are being dropped because
a) It's within the scope
b) It's a release app rather than a test app
Any ideas?
http1.1 does not pass scheme and authority with request, usually it is something like GET /index.html
to generate right urls you have to use connection info
Thank you kindly.
Most helpful comment
http1.1 does not pass scheme and authority with request, usually it is something like
GET /index.htmlto generate right urls you have to use connection info