remove gif support, send not allowed ext file #25

because it's not perfect
This commit is contained in:
Benny~ 2020-03-07 12:58:27 +08:00
parent ff0ec84d82
commit 6b266e8fb7
No known key found for this signature in database
GPG Key ID: 6CD0DBDA5235D481
2 changed files with 8 additions and 5 deletions

View File

@ -4,5 +4,10 @@
"QUALITY": "80",
"IMG_PATH": "/path/to/pics",
"EXHAUST_PATH": "",
"ALLOWED_TYPES": ["jpg","png","jpeg","bmp","gif"]
"ALLOWED_TYPES": [
"jpg",
"png",
"jpeg",
"bmp"
]
}

View File

@ -42,10 +42,8 @@ func Convert(ImgPath string, ExhaustPath string, AllowedTypes []string, QUALITY
}
}
if !allowed {
msg := "File extension not allowed!"
log.Warnf("%s %s", msg, ImgFilename)
c.Send(msg)
c.SendStatus(403)
log.Warnf("File extension not allowed! %s", ImgFilename)
c.SendFile(RawImageAbs)
return
}