mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-21 18:37:45 +08:00
When request is sent to http://localhost:8080/ipfs/$cid response has HTTP 301 status code and "Location" header with redirect destination at $cid.ipfs.localhost:8080 Redirect is followed by browsersi, but not by commandline tools. Status 301 is ignored by curl in default mode: it will print response and won't follow redirect, user needs to add -L for that. To fix curl, we return correct payload in body of HTTP 301 response, but set Clear-Site-Data header to ensure Origin sandbox can't be abused. This requires a surgical workaround: If Location header is present in ResponseWriter's Header map, we ensure http.ServeContent() returns HTTP 301 Context: https://github.com/ipfs/go-ipfs/pull/6982 License: MIT Signed-off-by: Marcin Rataj <lidel@lidel.org> |
||
|---|---|---|
| .. | ||
| commands.go | ||
| corehttp.go | ||
| gateway_handler.go | ||
| gateway_indexPage.go | ||
| gateway_test.go | ||
| gateway.go | ||
| hostname_test.go | ||
| hostname.go | ||
| lazyseek_test.go | ||
| lazyseek.go | ||
| logs.go | ||
| metrics_test.go | ||
| metrics.go | ||
| mutex_profile.go | ||
| option_test.go | ||
| p2p_proxy_test.go | ||
| p2p_proxy.go | ||
| redirect.go | ||
| webui.go | ||