Fix gateway handling of sharded directories
License: MIT Signed-off-by: Jeromy <jeromyj@gmail.com>
Jeromy committed
Apr 29, 2017 at 13:01 UTC
b71ef8354e11f67bd977c05189f630da0973cf05
2 files changed
+7
-1
test/sharness/t0260-sharding-flag.sh
+6
@@ -55,6 +55,12 @@ test_expect_success "sharded and unsharded output look the same" '
55
test_cmp sharded_out unsharded_out
56
'
57
58
+test_expect_success "ipfs cat error output the same" '
59
+ test_expect_code 1 ipfs cat "$SHARDED" 2> sharded_err &&
60
+ test_expect_code 1 ipfs cat "$UNSHARDED" 2> unsharded_err &&
61
+ test_cmp sharded_err unsharded_err
62
+'
63
+
64
test_add_large_dir_v1() {
65
exphash="$1"
66
test_expect_success "ipfs add (CIDv1) on very large directory succeeds" '
unixfs/io/dagreader.go
+1
-1
@@ -45,7 +45,7 @@ func NewDagReader(ctx context.Context, n node.Node, serv mdag.DAGService) (DagRe
45
}
46
47
switch pb.GetType() {
48
- case ftpb.Data_Directory:
48
+ case ftpb.Data_Directory, ftpb.Data_HAMTShard:
49
// Dont allow reading directories
50
return nil, ErrIsDir
51
case ftpb.Data_File, ftpb.Data_Raw: