forked from Gitlink/forgeplus
修复:创建文件需验证文件内容是否为base64
This commit is contained in:
parent
17bd3034bb
commit
3ae73ebf06
|
|
@ -61,7 +61,9 @@ class Gitea::Repository::Entries::CreateService < Gitea::ClientService
|
|||
else
|
||||
if json_parse!(body)["message"].present? && json_parse!(body)["message"].starts_with?("branch already exists")
|
||||
error("#{@body[:new_branch]}分支已存在!")
|
||||
else
|
||||
elsif json_parse!(body)["message"].present? && json_parse!(body)["message"].starts_with?("illegal base64 data at input byte 4")
|
||||
error("文件内容必须是base64编码的!")
|
||||
else
|
||||
error("#{filepath}文件已存在,不能重复创建!")
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in New Issue