1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-09-11 23:46:39 +08:00

remove hard-coded json content-type for streaming http output

There was a stale assumption that streaming output from a channel would
always be json.
This commit removes that code, allowing Content-Type to appropriately be
set like other, non-channel-streaming commands.

License: MIT
Signed-off-by: Cayman Nava <caymannava@gmail.com>
This commit is contained in:
Cayman Nava
2015-09-19 12:11:42 -07:00
committed by Cayman
parent ce11ed5e23
commit 9634b25b63
2 changed files with 61 additions and 5 deletions

View File

@ -224,13 +224,8 @@ func sendResponse(w http.ResponseWriter, r *http.Request, res cmds.Response, req
_, isChan = res.Output().(<-chan interface{})
}
streamChans, _, _ := req.Option("stream-channels").Bool()
if isChan {
h.Set(channelHeader, "1")
if streamChans {
// streaming output from a channel will always be json objects
mime = applicationJson
}
}
if mime != "" {