Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
G
go-ipfs
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
jihao
go-ipfs
Commits
1fb3b68f
提交
1fb3b68f
authored
3月 09, 2017
作者:
Jeromy Johnson
提交者:
GitHub
3月 09, 2017
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #3768 from ipfs/fix/cmd/get-empty-panic
fix: ipfs get panic with empty API call
上级
0d664043
66cc2f2e
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
13 行增加
和
1 行删除
+13
-1
get.go
core/commands/get.go
+5
-0
t0090-get.sh
test/sharness/t0090-get.sh
+8
-1
没有找到文件。
core/commands/get.go
浏览文件 @
1fb3b68f
...
...
@@ -51,6 +51,11 @@ may also specify the level of compression by specifying '-l=<1-9>'.
return
err
},
Run
:
func
(
req
cmds
.
Request
,
res
cmds
.
Response
)
{
if
len
(
req
.
Arguments
())
==
0
{
res
.
SetError
(
errors
.
New
(
"not enough arugments provided"
),
cmds
.
ErrClient
)
return
}
cmplvl
,
err
:=
getCompressOptions
(
req
)
if
err
!=
nil
{
res
.
SetError
(
err
,
cmds
.
ErrClient
)
...
...
test/sharness/t0090-get.sh
浏览文件 @
1fb3b68f
...
...
@@ -141,7 +141,7 @@ test_get_fail() {
'
test_expect_success
"ipfs get fails"
'
test_expect_code 1 ipfs get QmaGidyrnX8FMbWJoxp8HVwZ1uRKwCyxBJzABnR1S2FVUr
test_expect_code 1 ipfs get QmaGidyrnX8FMbWJoxp8HVwZ1uRKwCyxBJzABnR1S2FVUr
'
}
...
...
@@ -154,6 +154,13 @@ test_get_fail
# should work online
test_launch_ipfs_daemon
test_get_cmd
test_expect_success
"empty request to get doesn't panic and returns error"
'
curl "http://$API_ADDR/api/v0/get" > curl_out || true &&
grep "not enough arugments provided" curl_out
'
test_kill_ipfs_daemon
test_done
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论