{"action":"created","issue":{"url":"https://api.github.com/repos/elixir-lang/plug/issues/478","repository_url":"https://api.github.com/repos/elixir-lang/plug","labels_url":"https://api.github.com/repos/elixir-lang/plug/issues/478/labels{/name}","comments_url":"https://api.github.com/repos/elixir-lang/plug/issues/478/comments","events_url":"https://api.github.com/repos/elixir-lang/plug/issues/478/events","html_url":"https://github.com/elixir-lang/plug/issues/478","id":186102242,"number":478,"title":"Plug.Conn.put_resp_header doesn't allow multiple headers with the same name","user":{"login":"mdg","id":6962,"avatar_url":"https://avatars.githubusercontent.com/u/6962?v=3","gravatar_id":"","url":"https://api.github.com/users/mdg","html_url":"https://github.com/mdg","followers_url":"https://api.github.com/users/mdg/followers","following_url":"https://api.github.com/users/mdg/following{/other_user}","gists_url":"https://api.github.com/users/mdg/gists{/gist_id}","starred_url":"https://api.github.com/users/mdg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdg/subscriptions","organizations_url":"https://api.github.com/users/mdg/orgs","repos_url":"https://api.github.com/users/mdg/repos","events_url":"https://api.github.com/users/mdg/events{/privacy}","received_events_url":"https://api.github.com/users/mdg/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-10-29T21:33:32Z","updated_at":"2016-10-29T21:43:37Z","closed_at":"2016-10-29T21:43:37Z","body":"According to documentation, put_resp_header() replaces an existing value if one exists.\r\nhttps://hexdocs.pm/plug/Plug.Conn.html#put_resp_header/3\r\n\r\nHowever, the HTTP [RFC 2616](https://tools.ietf.org/html/rfc2616#section-4.2) says that:\r\n\r\n> 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)].\r\n\r\nThis 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."},"comment":{"url":"https://api.github.com/repos/elixir-lang/plug/issues/comments/257117743","html_url":"https://github.com/elixir-lang/plug/issues/478#issuecomment-257117743","issue_url":"https://api.github.com/repos/elixir-lang/plug/issues/478","id":257117743,"user":{"login":"josevalim","id":9582,"avatar_url":"https://avatars.githubusercontent.com/u/9582?v=3","gravatar_id":"","url":"https://api.github.com/users/josevalim","html_url":"https://github.com/josevalim","followers_url":"https://api.github.com/users/josevalim/followers","following_url":"https://api.github.com/users/josevalim/following{/other_user}","gists_url":"https://api.github.com/users/josevalim/gists{/gist_id}","starred_url":"https://api.github.com/users/josevalim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josevalim/subscriptions","organizations_url":"https://api.github.com/users/josevalim/orgs","repos_url":"https://api.github.com/users/josevalim/repos","events_url":"https://api.github.com/users/josevalim/events{/privacy}","received_events_url":"https://api.github.com/users/josevalim/received_events","type":"User","site_admin":false},"created_at":"2016-10-29T21:43:37Z","updated_at":"2016-10-29T21:43:37Z","body":"You can manually add the headers to the struct %{conn | resp_headers: set_cookie_headers ++ conn.resp_headers}`. In fact, if you are using a reverse proxy, that's like the simplest way to move  all headers over."}}
{"actor":{"display_login":"josevalim"}}