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:
@ -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 != "" {
|
||||
|
Reference in New Issue
Block a user