github.com/shurcooL/issuesapp/...

Improve use of http.Error. github.com/shurcooL/issuesapp#20

Closeddmitshur opened this issue 8 years ago
dmitshur commented 8 years ago

Calling it after the header has been written (likely with the wrong content-type) is incorrect and shouldn't be done.

Write Preview Markdown
dmitshur commented 7 years ago

A good pattern I've since found to take care of this is to have a func(w http.ResponseWriter, req *http.Request) error handler signature, and keep track of whether the response writer has been written to. See here.

Write Preview Markdown
dmitshur commented 4 years ago

Resolved a while ago in commit 431bb22d.

Write Preview Markdown
dmitshur closed this 4 years ago
to comment.