Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
commands/http/handler: Write a trailer with any error messages
For streaming responses (e.g. 'ipfs add -r /path/to/root/directory'), we may hit errors later on in the stream, after we've already written the initial 200 response and started in on the streaming body (e.g. /path/to/root/directory/a/b/c is an unsupported file type). We should check for that sort of error, and set a trailer [1] if there were any errors. Unfortunately, it's a bit awkward to set these headers in Go 1.4 and earlier [2], but [2] does have a workaround for Go 1.4 (it's not clear if the workaround is compatible with Go 1.3). [1]: http://tools.ietf.org/html/rfc2616#section-14.40 [2]: golang/go#7759 License: MIT Signed-off-by: W. Trevor King <wking@tremily.us>
- Loading branch information
Showing
2 changed files
with
25 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters