elixir-lang/plug — pull request #133 by whatyouhide (2014-12-04 09:21:35+00:00)
Title: Fail in Plug.Conn.put_status/2 when the resp had already been sent

Most of the `Plug.Conn` functions raise an `AlreadySentError` when the response has already been sent. This commit introduces the code and tests that make this function behave like the others.

I'm not 100% sure that `put_status/2` is similar to functions like, say, `put_resp_header/3` but I think so. One thing that doubted me is that `put_status/2` has no `put_resp_body/2` counterpart (you need to use `resp/3`). Is there a particular reason for that?

As always, thanks in advance!