Previously, this was the result when running a test with go1.6rc2:
go test github.com/ipfs/go-ipfs/commands/http
panic: net/http: CloseNotify called after ServeHTTP finished
goroutine 19 [running]:
net/http.(*response).CloseNotify(0xc8202ca1a0, 0x0)
/home/r/go/src/net/http/server.go:1533 +0x9d
github.com/ipfs/go-ipfs/commands/http.internalHandler.ServeHTTP.func2(0x7f42c9d1d180, 0xc8202ca1a0, 0x7f42c9d66e90, 0xc8200f0380, 0xc8201d40d0)
/home/r/src/github.com/ipfs/go-ipfs/commands/http/handler.go:143 +0x39
created by github.com/ipfs/go-ipfs/commands/http.internalHandler.ServeHTTP
/home/r/src/github.com/ipfs/go-ipfs/commands/http/handler.go:147 +0x49d
FAIL github.com/ipfs/go-ipfs/commands/http 0.013s
I had also encountered this panic when trying to use the webui.
License: MIT
Signed-off-by: Robert Carlsen <rwcarlsen@gmail.com>
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
use go1.5 syntax to ensure builds on older versions fail
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
fix t0230
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
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>
need to do it this way to avoid VERY confusing situations where
the user would change the API port (to another port, or maybe even
to :0). this way things dont break on the user, and by default,
users only need to change the API address and things should still
"just work"
License: MIT
Signed-off-by: Juan Batiz-Benet <juan@benet.ai>
this commit makes the API handler short circuit the request if the
CORS headers say its not allowed. (the CORS handler only sets the
headers, but does not short-circuit)
It also makes the handler respect the referer again. See security
discussion at https://github.com/ipfs/go-ipfs/issues/1532
License: MIT
Signed-off-by: Juan Batiz-Benet <juan@benet.ai>
this commit adds the ability to specify arbitrary HTTP headers
for either the Gateway or the API. simply set the desired headers
on the config:
ipfs config --json API.HTTPHeaders.X-MyHdr '["meow :)"]'
ipfs config --json Gateway.HTTPHeaders.X-MyHdr '["meow :)"]'
License: MIT
Signed-off-by: Juan Batiz-Benet <juan@benet.ai>
stream output might break. in these cases we need to notify the
client. this is after a 200 response has been sent. We do this
by setting a special trailer (header after the body):
X-Stream-Error: <error cause>
This is similar to what's done by systems like gRPC. This still
needs to be read + handled on the other side.
License: MIT
Signed-off-by: Juan Batiz-Benet <juan@benet.ai>
commands/object: remove objectData() and objectLinks() helpers
resolver: added context parameters
sharness: $HASH carried the \r from the http protocol with
sharness: write curl output to individual files
http gw: break PUT handler until PR#1191