这是indexloc提供的服务,不要输入任何密码
Skip to content

Request URL only includes the path + query string #232

@Angelmmiguel

Description

@Angelmmiguel

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

Metadata

Metadata

Assignees

Labels

🐛 bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions