1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-08-06 03:19:47 +08:00

241 Commits

Author SHA1 Message Date
72490f7ed0 gateway: simplify/improve dnslink rewrite handling
Instead of adding a new fake header (that could be spoofed by the client...),
just read the original request URI from the request object.

This also removes support for suborigins. They have never been implemented in
browsers and it looks like efforts have stalled. We can add support back if we
need it but, well, maintaining support was going to be more trouble than it was
worth.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2020-03-17 19:34:44 -07:00
a53d48059b fix: migrate from deprecated warning function 2020-01-28 21:20:21 -08:00
725e6844ee gateway: cleanup logic
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2020-01-10 10:19:13 +01:00
5eea0a4ba0 http: use Method* constants
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2020-01-10 10:19:08 +01:00
453b78962b chore(gateway): remove dead code 2020-01-05 16:43:45 -08:00
1a06fb6e2f fix(gateway): correct symlink content type
We should be _resolving_ symlinks (sometimes, still need to figure out when to
do this WRT IPNS). However, that's a larger feature.
2020-01-05 16:43:44 -08:00
3859f08bf7 fix(gateway): better seeking/sized
1. Require files to have known sizes. We can add support for unknown sizes
_later_ but we can't use ServeContent for those files.
2. Replace the `sizeReadSeeker` with a `lazySeeker`. This one makes no
assumptions about how it's used so we're less likely to run into weird bugs.
2020-01-05 16:43:44 -08:00
e8a6c0c050 fix(gateway): gracefully handle files with unknown sizes in directory listings 2020-01-05 16:43:44 -08:00
62451039ec fix(gateway): serve the index with serveFile 2020-01-05 16:43:44 -08:00
115b2ba6cd fix: limit SW registration to content root
Introduces hardening proposed in:
https://github.com/ipfs/go-ipfs/issues/4025#issuecomment-342250616

License: MIT
Signed-off-by: Marcin Rataj <lidel@lidel.org>
2019-12-17 02:20:40 +01:00
7ae6f6fa3e chore(gateway): document encoding fix 2019-11-06 11:47:27 +00:00
69f6e08d9d chore(gateway): remove redundant seek 2019-11-06 11:45:41 +00:00
a12d2e265e chore(gateway): fix error call 2019-11-06 11:44:56 +00:00
ebf2e7da36 chore(gateway): fix import ordering 2019-11-06 11:44:32 +00:00
a29a9dbb98 gateway: ServeFile: use file extension to determine Content-Type
License: MIT
Signed-off-by: Abdeldjalil Hebal <dreamski21@gmail.com>
2019-11-06 01:52:49 +01:00
69f81a11dd Update gateway_handler.go 2019-11-05 17:36:26 +01:00
aefff48654 fix #2203: omit the charset attribute when Content-Type is text/html
License: MIT
Signed-off-by: Abdeldjalil Hebal <dreamski21@gmail.com>
2019-11-02 21:56:54 +01:00
521a29956b fix and improve the writable gateway
1. Fix handling of PUT. The simple implementation was the correct
   implementation, I have no idea what was going on here.
2. Use MFS everywhere to reduce code duplication and add support for sharded
   directories.
3. _Correctly_ block IPNS.
4. Remove the dependency on `core.IpfsNode`.
5. Remove support for putting empty directories with a well-known CID. It was
   useless as directories are automatically created.
2019-07-25 19:22:56 -07:00
d460150f43 gateway: label get requests latency with the path namespace 2019-06-04 17:47:08 -07:00
846b6b5d95 add unixfs get metric
License: MIT
Signed-off-by: whyrusleeping <why@ipfs.io>
2019-06-04 17:36:42 -07:00
e8c2852179 migrate to go-libp2p-core.
closes #6391

License: MIT
Signed-off-by: Raúl Kripalani <raul@protocol.ai>
2019-05-31 23:23:52 -07:00
23d35184c3 fix: use http.Error for sending errors
This sets a few headers that prevent browsers from misinterpreting the error
text.
2019-05-25 10:45:17 -07:00
tg
d2836de577 core/corehttp/gateway_handler: pass a request ctx instead of the node ctx
License: MIT
Signed-off-by: Georgij Tolstov <tolstov.georgij@gmail.com>
2019-04-23 13:43:32 +03:00
7046626ecc Move pathresolve
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2019-04-17 16:56:27 -07:00
a54b64bede coreiface: updates for path name refactor
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2019-04-17 12:03:37 -07:00
667b7f9927 coreiface: updates for moving path to subpackage
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2019-04-17 12:03:37 -07:00
2e77df04ca coreapi: Update path error handling
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2019-04-17 12:03:37 -07:00
42e191c017 gx: unrewrite
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2019-03-05 18:33:56 +01:00
3dac4609a8 split 'mode' into IsOnline and IsDaemon flags
1. They don't _have_ to be mutually exclusive.
2. local, mode, etc is _really_ confusing.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2019-03-04 19:00:47 -08:00
f227862e88 gx: update go-ipfs-cmds, go-bitswap, go-libp2p-kad-dht, and go-mplex
Fixes the latest batch of bugs found in RC testing.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2019-02-27 12:39:24 -08:00
6972a9aa4d Gx Bubble. libp2p-6.0.38
License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2019-02-27 01:10:59 +00:00
fea7ae727f gx: update go-cid
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2019-02-20 20:29:06 -08:00
f924f57c61 gx: update go-bitswap and go-libp2p-kad-dht
* go-bitswap: fix some race conditions.
* go-libp2p-kad-dht: fix a goroutine leak.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2019-02-20 17:19:54 -08:00
2f17b951c2 gx: update deps
* Updates go-ipfs-cmds to try to get the tests to pass on travis.
* While we're at it, fix duplicate gx deps.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2019-02-19 13:12:21 -08:00
91ca5911be coreapi: return coreiface.ErrNotSupported when "catting" symlinks.
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2019-02-19 03:48:04 -08:00
28cf3de0f9 Update protobuf
License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
2019-02-18 20:46:22 +01:00
cf0d4706e2 gx: update libp2p stuff
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2019-02-14 14:58:35 -08:00
e97a60b073 gx: update go-ipfs-files
fix compatibility issue with js-ipfs

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2019-02-11 10:48:58 -08:00
648cc40ec3 coreapi: fix import grouping after extracting iface
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2019-02-09 01:57:26 +01:00
7ed6b518b6 coreapi: update imports to updated interface
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2019-02-09 01:42:32 +01:00
2c93eeffc6 gx: update go-libp2p-peer
Switch _back_ to the 0.4.18 style of peer IDs while we figure things out. See
https://github.com/libp2p/specs/issues/138.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2019-02-07 17:41:39 -08:00
7c2aa0e9a9 gx: update go-unixfs to propagate archive changes
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2019-01-30 20:58:32 +01:00
53e55e3314 gx: update go-unixfs to 1.2.14 and go-bitswap to 1.1.21
(and everything else...)

License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2019-01-23 11:01:38 -08:00
08cc5da55f gx: update deps
Importantly:

* fixes a bunch of MFS bugs
* pulls in some bitswap improvements

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2019-01-08 19:19:34 -08:00
42a15ba7e4 Merge pull request #5893 from ipfs/fix/gateway-headers
gateway: fix CORs headers
2019-01-08 13:25:08 -08:00
a142aecf9b Merge pull request #5649 from ipfs/feat/gateway-nofetch
Local Gateway option
2019-01-07 10:06:08 -08:00
818e0e40c7 gateway: cleanup err switch
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
2019-01-05 22:29:46 +01:00
65fc4b45e9 gateway index: fix check for displaying CID.
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2019-01-05 11:16:17 -08:00
9ef1486307 show hash if not in original url
Change the template handler to pass the hash to the directory listing template if the original url doesn't contain the hash. The directory listing template will display the hash in grey under the original url if the hash is passed to it.

License: MIT
Signed-off-by: Jack Loughran <j@ckloughran.com>
2019-01-05 11:16:17 -08:00
82629c00ec gateway: fix CORs headers
fixes #5138 -- always add user-agent to access-control-allow-headers.
fixes #5888 -- same with content-type.
fixes #5892 -- extend user-provided headers instead of overriding them.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
2019-01-04 13:18:03 -08:00