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.
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:
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.