mirror of
https://github.com/ipfs/kubo.git
synced 2025-09-15 11:13:37 +08:00
some commenting
License: MIT Signed-off-by: Jeromy <jeromyj@gmail.com>
This commit is contained in:
@ -193,6 +193,7 @@ func sendResponse(w http.ResponseWriter, req cmds.Request, res cmds.Response) {
|
||||
mime = applicationJson
|
||||
}
|
||||
}
|
||||
|
||||
if mime != "" {
|
||||
h.Set(contentTypeHeader, mime)
|
||||
}
|
||||
@ -207,6 +208,7 @@ func sendResponse(w http.ResponseWriter, req cmds.Request, res cmds.Response) {
|
||||
// Copies from an io.Reader to a http.ResponseWriter.
|
||||
// Flushes chunks over HTTP stream as they are read (if supported by transport).
|
||||
func copyChunks(status int, w http.ResponseWriter, out io.Reader) error {
|
||||
// hijack the connection so we can write our own chunked output and trailers
|
||||
hijacker, ok := w.(http.Hijacker)
|
||||
if !ok {
|
||||
log.Error("Failed to create hijacker! cannot continue!")
|
||||
|
Reference in New Issue
Block a user