Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request URL only includes the path + query string #232

Closed
Angelmmiguel opened this issue Oct 16, 2023 · 0 comments · Fixed by #234
Closed

Request URL only includes the path + query string #232

Angelmmiguel opened this issue Oct 16, 2023 · 0 comments · Fixed by #234
Assignees
Labels
🐛 bug Something isn't working
Milestone

Comments

@Angelmmiguel
Copy link
Contributor

Angelmmiguel commented Oct 16, 2023

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

  1. Create a JavaScript worker
  2. Print the URL with console.log(request.url)
  3. 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

@Angelmmiguel Angelmmiguel added the 🐛 bug Something isn't working label Oct 16, 2023
@Angelmmiguel Angelmmiguel added this to the 1.7.0 milestone Oct 16, 2023
@Angelmmiguel Angelmmiguel self-assigned this Oct 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant