mirror of
https://github.com/woodchen-ink/webp_server_go.git
synced 2025-07-18 13:42:02 +08:00
remove gif support, send not allowed ext file #25
because it's not perfect
This commit is contained in:
parent
ff0ec84d82
commit
6b266e8fb7
@ -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"
|
||||
]
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user