Skip to content

lambda_http::Request should expose a QueryMap from a raw_query_string #470

Closed
@adriandelgado

Description

@adriandelgado

This is a follow-up to this issue @calavera

I had a new idea while reading closely the Payload format Version 2.0. There is a rawQueryString field! This means we can use this field to correctly parse query parameters into a QueryMap.

The lambda_http crate already appends this raw_query_string into the Uri of the request (as seen in the function request::into_api_gateway_v2_request), and the wrong QueryStringParameters are put inside an extension of the request.

So my idea is... maybe we can also expose theraw_query_string in some way but already parsed into a QueryMap. Something like an extension that can be accessed through the RequestExt trait. My reasoning is that most people using API Gateway expect the QueryStringParameters to behave according to the whatwg spec.

Maybe we can put a warning about this weird quirk of AWS in the documentation of RequestExt::query_string_parameters and push devs to use a new method like raw_query_string.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions