1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-06-30 18:13:54 +08:00

4560 Commits

Author SHA1 Message Date
8f35c3bcd9 more serious CORS tests.
this commit introduces more serious CORS tests that check
status response codes, and run real HTTP requests.

License: MIT
Signed-off-by: Juan Batiz-Benet <juan@benet.ai>
2015-07-28 23:08:11 -07:00
d5f94be474 fix API handler to respect referer + exit on CORS
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>
2015-07-28 23:08:11 -07:00
5d9ee59908 address CR comment re interface in cmds http handler
https://github.com/ipfs/go-ipfs/pull/1529#discussion_r35662230

License: MIT
Signed-off-by: Juan Batiz-Benet <juan@benet.ai>
2015-07-28 23:08:10 -07:00
4a571b099b implement arbitrary HTTP header support
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>
2015-07-28 23:08:10 -07:00
c633e2b575 cmds/http: remove referrer check
it used to be here for a CSRF check. but we now have CORS checks.

License: MIT
Signed-off-by: Juan Batiz-Benet <juan@benet.ai>
2015-07-28 23:08:09 -07:00
7cf5e87cfe Added API + Gateway support for arbitrary HTTP headers
This commit fixes + improves CORS support

License: MIT
Signed-off-by: Juan Batiz-Benet <juan@benet.ai>
2015-07-28 23:08:09 -07:00
e517b657fc Merge pull request #1506 from ipfs/feat/patch-create
allow patch to optionally create intermediate dirs
2015-07-28 23:05:40 -07:00
aa7d946716 a little more test coverage on merkledag
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-07-28 21:42:28 -07:00
b32d0ef153 implement 'editor' abstraction
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-07-28 15:00:07 -07:00
314f7bbfea space out sharness test calls
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-07-28 15:00:07 -07:00
7c510662ae break merkledag utils into its own package
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-07-28 15:00:07 -07:00
194eb7c0dc more tests and better path handling in object
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-07-28 15:00:07 -07:00
bfe4e4be4f let rm understand paths
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-07-28 15:00:07 -07:00
870df2431a allow patch to optionally create intermediate dirs
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-07-28 15:00:07 -07:00
681da0aa21 Merge pull request #1531 from ipfs/fix/stream-header
only set stream header on streamed output
2015-07-28 12:59:54 -07:00
98559d0e0b put comment back 2015-07-28 08:44:35 -07:00
4c8f065ac2 Merge pull request #1530 from ipfs/fix/diag
rmeove duplicate timeout option from diag
2015-07-28 08:38:03 -07:00
4cce2e6730 Merge pull request #1468 from sbruce/better-cli-parser-errors
Better error message on unrecognized command
2015-07-28 08:37:20 -07:00
c175700dea Better error message on unrecognized command
Closes issue #1436

License: MIT
Signed-off-by: Shaun Bruce <shaun.m.bruce@gmail.com>
2015-07-28 09:20:53 -06:00
2cad99d5ef only set stream header on streamed output
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-07-28 08:18:31 -07:00
f2b44e3338 rmeove duplicate timeout option from diag
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-07-28 08:17:42 -07:00
075e68782c Merge pull request #1526 from ipfs/fix-gobuilder-dist
updated gobuilder dist
2015-07-28 07:52:36 -07:00
470de9222d updated gobuilder dist
https://github.com/Luzifer/gobuilder/pull/52

License: MIT
Signed-off-by: Juan Batiz-Benet <juan@benet.ai>
2015-07-28 06:35:50 -07:00
0432966a5d Merge pull request #1527 from ipfs/fix-refs-u
Fix refs u
2015-07-28 06:33:42 -07:00
490ed41c45 sharness/ipfs refs bigger tests
License: MIT
Signed-off-by: Juan Batiz-Benet <juan@benet.ai>
2015-07-28 06:14:20 -07:00
8fe7d2f571 Fix refs -r -u for #1211
License: MIT
Signed-off-by: Gaetan Voyer-Perrault <gatesvp@gmail.com>
2015-07-28 06:14:20 -07:00
a5521fcc76 sharness/repo: fix pinning test
looks like the test was broken by GC-ing everything.
the pin expects $HASH to still be there.

License: MIT
Signed-off-by: Juan Batiz-Benet <juan@benet.ai>
2015-07-28 06:14:13 -07:00
29f67b4275 Merge pull request #1523 from rht/reversible-gc
Add reversible gc test
2015-07-28 05:16:39 -07:00
rht
eb45082103 Add reversible gc test
License: MIT
Signed-off-by: rht <rhtbot@gmail.com>
2015-07-28 09:47:15 +07:00
f417cb5ceb Merge pull request #1510 from ipfs/pinfail-debug
print output on test failure for t0081
2015-07-27 18:41:31 -07:00
870d85080a Merge pull request #1516 from rht/progressbar
Clear progress bar on `ipfs cat` exit
2015-07-27 18:39:37 -07:00
138198e786 print output on test failure for t0081
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-07-27 18:34:37 -07:00
aaaf884c9a Merge pull request #1519 from ipfs/get-fix
Implement http trailers for error handling
2015-07-27 17:56:18 -07:00
8176766d5a naming and cleanup
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-07-27 17:25:38 -07:00
0c4b10afb2 comment need for custom client
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-07-27 15:19:43 -07:00
23d41e0823 address comments from CR and fix random failures
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-07-27 09:30:52 -07:00
1ce310be8b some commenting
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-07-26 11:28:53 -07:00
fd75b64630 refactor http client code
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-07-25 19:56:45 -07:00
2b06ffaa7d better refactor of http handler code
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-07-25 18:46:44 -07:00
a7e50f1fbc implement http trailers for errors after headers are sent
refactor http handler and copyChunks to get this all to work correctly
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-07-25 11:07:31 -07:00
814f437fb4 cmds/http/handler: set stream error trailer
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>
2015-07-24 14:49:34 -07:00
e3c35d8b76 cmds/get: fix context timeout problem
Get had a random timeout of 60s. This commit fixes that, wiring
up our contexts correctly.

License: MIT
Signed-off-by: Juan Batiz-Benet <juan@benet.ai>
2015-07-24 14:43:17 -07:00
886d47561a http/client: log errors when stream copy fails
License: MIT
Signed-off-by: Juan Batiz-Benet <juan@benet.ai>
2015-07-24 14:41:57 -07:00
rht
818d3af827 Clear progress bar on ipfs cat exit
License: MIT
Signed-off-by: rht <rhtbot@gmail.com>
2015-07-24 23:04:57 +07:00
633b66d8ec Merge pull request #1511 from ipfs/fix/windows
vendor lib so windows builds work again
2015-07-23 17:40:40 -07:00
f0badb6ced vendor lib so windows builds work again
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-07-23 15:12:23 -07:00
ebfdb3a4d8 Merge pull request #1501 from ipfs/fix/notif-test
fix race condition in notifications test
2015-07-23 15:10:39 -07:00
47cd70fa7d fix same test in swarm
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-07-22 16:15:50 -07:00
b60f494c1e fix race condition in notifications test
License: MIT
Signed-off-by: Jeromy <jeromyj@gmail.com>
2015-07-22 14:38:13 -07:00
8c0ca5e376 Merge pull request #1507 from ipfs/fix/http-client-close
attempt at properly closing http response bodies
2015-07-22 13:47:52 -07:00