- add comments, trim api path prefix
- corehttp: add option to set HTTP header "Server"
- daemon: use new corehttp options
License: MIT
Signed-off-by: keks <keks@cryptoscope.co>
Note: This commit is technically broken. However, I need to make a bunch of
cmds changes to make this work and I'd rather not bundle both changes into a
single commit.
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.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>
ServeOptions take the node and muxer, they should get the listener
too as sometimes they need to operate on the listener address.
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>
Each option now additionally returns the mux to be used by future options. If
every options returns the mux it was passed, the current behavior is unchanged.
However, if the option returns an a new mux, it can mediate requests to handlers
provided by future options:
return func(n *core.IpfsNode, mux *http.ServeMux) (*http.ServeMux, error) {
childMux := http.NewServeMux()
mux.Handle("/", handlerThatDelegatesToChildMux)
return childMux, nil
}
License: MIT
Signed-off-by: Kevin Wallace <kevin@pentabarf.net>