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

The query string is not present in the request object #92

@Angelmmiguel

Description

@Angelmmiguel

When wws calls a worker, it sends the HTTP request as a serialized object. It includes all the required values to build a Request object inside the worker. Currently, the url does not include the query string. This is relevant information so we should ensure we send it as part of the URL.

pub fn new(
request: &'a HttpRequest,
body: &'a str,
kv: Option<HashMap<String, String>>,
) -> Self {
let mut params = HashMap::new();
for (k, v) in request.match_info().iter() {
params.insert(k.to_string(), v.to_string());
}
Self {
url: request.uri().path(),
method: request.method().as_str(),
headers: Self::build_headers_hash(request.headers()),
body,
kv: kv.unwrap_or_default(),
params,
}
}

The .uri().path() method doesn't include the query string. There's an alternative path_and_query() path we can use for this purpose.

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