kubo/core
Marcin Rataj f9567a0a0f fix(gateway): curl without redirect on localhost
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>
2020-03-18 08:50:40 -07:00
..
bootstrap fix(tracing): remove event tracing 2020-01-28 21:31:12 -08:00
commands Merge pull request #6602 from ipfs/feat/coreapi-mount 2020-03-06 22:30:12 -08:00
coreapi Fix Typos 2019-12-25 03:12:41 +00:00
coredag gx: unrewrite 2019-03-05 18:33:56 +01:00
corehttp fix(gateway): curl without redirect on localhost 2020-03-18 08:50:40 -07:00
corerepo fix(tracing): remove event tracing 2020-01-28 21:31:12 -08:00
coreunix support async datastores 2019-12-19 00:59:31 -05:00
mock migrate to go-libp2p-core. 2019-05-31 23:23:52 -07:00
node update to new private network interfaces 2020-03-09 19:39:06 -07:00
.gitignore ignore testdb 2014-07-05 15:04:04 -07:00
builder.go Separate imports 2019-05-29 16:20:31 -07:00
core_test.go gx: unrewrite 2019-03-05 18:33:56 +01:00
core.go feat(graphsync): mount the graphsync libp2p protocol 2020-02-26 09:11:15 -08:00