Skip to content

Plug.Conn.put_resp_header doesn't allow multiple headers with the same name #478

@mdg

Description

@mdg

According to documentation, put_resp_header() replaces an existing value if one exists.
https://hexdocs.pm/plug/Plug.Conn.html#put_resp_header/3

However, the HTTP RFC 2616 says that:

Multiple message-header fields with the same field-name MAY be present in a message if and only if the entire field-value for that header field is defined as a comma-separated list [i.e., #(values)].

This is particularly problematic when trying to add multiple Set-Cookie headers that are already encoded into the cookie format. I've encountered this issue while trying to write a reverse proxy w/ Plug and I'd like to be able to pass the upstream cookies straight into the Plug.Conn object w/o having to parse them and then reset them into the Plug.Conn cookie structure.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions