{"action":"created","issue":{"url":"https://api.github.com/repos/elixir-lang/plug/issues/232","labels_url":"https://api.github.com/repos/elixir-lang/plug/issues/232/labels{/name}","comments_url":"https://api.github.com/repos/elixir-lang/plug/issues/232/comments","events_url":"https://api.github.com/repos/elixir-lang/plug/issues/232/events","html_url":"https://github.com/elixir-lang/plug/issues/232","id":69838849,"number":232,"title":"put_resp_header should throw an error on state :chunked","user":{"login":"AntonFagerberg","id":1349615,"avatar_url":"https://avatars.githubusercontent.com/u/1349615?v=3","gravatar_id":"","url":"https://api.github.com/users/AntonFagerberg","html_url":"https://github.com/AntonFagerberg","followers_url":"https://api.github.com/users/AntonFagerberg/followers","following_url":"https://api.github.com/users/AntonFagerberg/following{/other_user}","gists_url":"https://api.github.com/users/AntonFagerberg/gists{/gist_id}","starred_url":"https://api.github.com/users/AntonFagerberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AntonFagerberg/subscriptions","organizations_url":"https://api.github.com/users/AntonFagerberg/orgs","repos_url":"https://api.github.com/users/AntonFagerberg/repos","events_url":"https://api.github.com/users/AntonFagerberg/events{/privacy}","received_events_url":"https://api.github.com/users/AntonFagerberg/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-04-21T12:57:50Z","updated_at":"2015-04-22T17:10:39Z","closed_at":null,"body":"According to the documentation, `put_resp_header` raises a Plug.Conn.AlreadySentError if the connection has already been `:sent`. This behavior should also apply for the state `:chunked`, which is a final state.\r\n\r\nAs it is now, the following example code will silently discard the header `test-b`.\r\n```elixir\r\nconn\r\n|> put_resp_header(\"test-a\", \"test 1\")\r\n|> send_chunked(200)\r\n|> put_resp_header(\"test-b\", \"test 2\")\r\n```"},"comment":{"url":"https://api.github.com/repos/elixir-lang/plug/issues/comments/95267377","html_url":"https://github.com/elixir-lang/plug/issues/232#issuecomment-95267377","issue_url":"https://api.github.com/repos/elixir-lang/plug/issues/232","id":95267377,"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":"2015-04-22T17:10:39Z","updated_at":"2015-04-22T17:10:39Z","body":"Yes, unfortunately this is a bit non-trivial to fix. We'd need a new field in the connection. Let's hold a bit and see if we can find a better solution."}}