Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion modules/upload/filetype.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ func VerifyAllowedContentType(buf []byte, allowedTypes []string) error {
allowed := false
for _, t := range allowedTypes {
t := strings.Trim(t, " ")
if t == "*/*" || t == fileType {

if t == "*/*" || t == fileType ||
// allowed text/plain; charset=utf-8
strings.HasPrefix(fileType, t+";") {
allowed = true
break
}
Expand Down