Request URL only includes the path + query string
Angelmmiguel opened this issue · comments
Describe the bug
When wws
builds the information to pass to the workers, it uses the WasmInput
struct. This struct contains multiple fields like params, method and url. The url
value should include the full URL of the current request, including the schema and authority section (host and port).
Currently, it's only including the path
and the query_string
. Some frameworks like HonoJS requires the entire URL to work, so they can properly match the route you want to serve. Checking the Request object from the browser API, the url
property includes all the information.
Reproduction steps
- Create a JavaScript worker
- Print the URL with
console.log(request.url)
- Check it doesn't include the schema and the authority section
Expected behavior
The url
value contains the full URL. If for any reason wws
cannot retrieve this information, it defaults to the path and query string. There's an open discussion about this topic on the actix-web
repository: actix/actix-web#2895.
Additional context
No response