Skip to content

Commit

Permalink
Merge pull request #287 from alimy/pr-zip-valid
Browse files Browse the repository at this point in the history
optmize #286 add missing web/dist file
  • Loading branch information
alimy committed May 4, 2023
2 parents 5be3ea3 + ddc7bf2 commit 52c891f
Show file tree
Hide file tree
Showing 30 changed files with 252 additions and 246 deletions.
5 changes: 4 additions & 1 deletion internal/servants/web/routers/api/attachment.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ func GetFileExt(s string) (string, error) {
return ".mp4", nil
case "video/quicktime":
return ".mov", nil
case "application/zip":
case "application/zip",
"application/x-zip",
"application/octet-stream",
"application/x-zip-compressed":
return ".zip", nil
default:
return "", errcode.FileInvalidExt.WithDetails("仅允许 png/jpg/gif/mp4/mov/zip 类型")
Expand Down
5 changes: 4 additions & 1 deletion internal/servants/web/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,10 @@ func getFileExt(s string) (string, mir.Error) {
return ".mp4", nil
case "video/quicktime":
return ".mov", nil
case "application/zip", "application/x-zip", "application/octet-stream", "application/x-zip-compressed":
case "application/zip",
"application/x-zip",
"application/octet-stream",
"application/x-zip-compressed":
return ".zip", nil
default:
return "", _errFileInvalidExt.WithDetails("仅允许 png/jpg/gif/mp4/mov/zip 类型")
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 52c891f

Please sign in to comment.