Open lann opened 1 year ago
I believe it is because we are explicitly modifying the request uri here: https://github.com/fermyon/spin/blob/9c888ff9ffddf4927184a21afd519ccd63202250/crates/trigger-http/src/lib.rs#L194. We could remove this line and be compatible
That would change requests for all inbound requests including existing interfaces, which might break existing apps. Updated description to specify that this should change only for the new wasi inbound interface.
From https://github.com/fermyon/http-auth-middleware/pull/4#issue-1973344440
I believe this is due to the Rust SDK's conditional reconstruction of the full URI:
https://github.com/fermyon/spin/blob/1f7cc3f54a2c8d96a24767bfcaa93ebc3b8982f5/sdk/rust/src/http.rs#L450-L464
If scheme and/or authority is missing, this will return just the path.
While technically a URI must have a scheme and authority, it appears that
http::Request::uri
(amongst others) produces just a path for inbound requests on many servers.For compatibility reasons I think we should align with that for inbound wasi-http, though it will be annoying to adjust the conversions.