You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I need the full URL in a response handler. Request.uri() should print the full URL (e.g. https://example.com/hello-world).
Current Behavior
Prints the path (/hello-world), which is not a valid URI.
Possible Solution
Suggestion:
The URI struct should always be a valid URI, which means it must have a schema + host + origin.
The current behavior of req.uri() returns the path of the URI. I think a .path() method is a better name for this. Add a full_uri() method that returns the full URI.
the key here is that Uri is designed to be used in the request-target location eg:
GET /my/path
^^^^^^^^ this bit
but in HTTP/2 you have to put the full URI here instead of using the Host header
i feel like a solution would be a new method .full_uri() which tries to build the whole thing from host and path
Expected Behavior
I need the full URL in a response handler.
Request.uri()
should print the full URL (e.g.https://example.com/hello-world
).Current Behavior
Prints the path (
/hello-world
), which is not a valid URI.Possible Solution
Suggestion:
URI
struct should always be a valid URI, which means it must have a schema + host + origin.req.uri()
returns thepath
of the URI. I think a.path()
method is a better name for this. Add afull_uri()
method that returns the full URI.Steps to Reproduce (for bugs)
Your Environment
rustc -V
): rustc 1.63.0 (4b91a6ea7 2022-08-08)The text was updated successfully, but these errors were encountered: