Skip to content

HTTP Headers can't be stored in a HashMap #121

@crazytonyli

Description

@crazytonyli

To track this TODO

// TODO: We probably want to implement a specific type for these headers instead of using a
// regular HashMap.
//
// It could be something similar to `reqwest`'s [`header`](https://docs.rs/reqwest/latest/reqwest/header/index.html)
// module.
pub header_map: Option<HashMap<String, String>>,


HashMap is not suitable for storing HTTP headers, since header name can repeat. For example, HTTP responses can contain multiple Link headers:

Finally, this header field:

Link: https://example.org/; rel="start",
https://example.org/index; rel="index"

is equivalent to these:

Link: https://example.org/; rel="start"
Link: https://example.org/index; rel="index"

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions