Skip to content

Commit

Permalink
Merge pull request #9 from vmkteam/allow-any-mime-type
Browse files Browse the repository at this point in the history
Allow any mime types via *
  • Loading branch information
sergeyfast authored Oct 13, 2023
2 parents 711392c + 56ce796 commit c300e36
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/vfssrv/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ var (
flWebPath = fs.String("webpath", "/media/", "web path to files")
flPreviewPath = fs.String("preview-path", "/media/small/", "preview path to image files")
flExtensions = fs.String("ext", "jpg,jpeg,png,gif", "allowed file extensions for hash upload, separated by comma")
flMimeTypes = fs.String("mime", "image/jpeg,image/png,image/gif", "allowed mime types for hash upload, separated by comma")
flMimeTypes = fs.String("mime", "image/jpeg,image/png,image/gif", "allowed mime types for hash upload, separated by comma (use * for any)")
flDbConn = fs.String("conn", "postgresql://localhost:5432/vfs?sslmode=disable", "database connection dsn")
flJWTKey = fs.String("jwt-key", "QuiuNae9OhzoKohcee0h", "JWT key")
flJWTHeader = fs.String("jwt-header", "AuthorizationJWT", "JWT header")
Expand Down
4 changes: 4 additions & 0 deletions vfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,10 @@ func (v VFS) IsValidMimeType(mType string) bool {
}

for _, m := range v.cfg.MimeTypes {
if m == "*" {
return true
}

if m == mType {
return true
}
Expand Down

0 comments on commit c300e36

Please sign in to comment.