mirror of
https://github.com/woodchen-ink/webp_server_go.git
synced 2025-07-18 21:52:01 +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",
|
"QUALITY": "80",
|
||||||
"IMG_PATH": "/path/to/pics",
|
"IMG_PATH": "/path/to/pics",
|
||||||
"EXHAUST_PATH": "",
|
"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 {
|
if !allowed {
|
||||||
msg := "File extension not allowed!"
|
log.Warnf("File extension not allowed! %s", ImgFilename)
|
||||||
log.Warnf("%s %s", msg, ImgFilename)
|
c.SendFile(RawImageAbs)
|
||||||
c.Send(msg)
|
|
||||||
c.SendStatus(403)
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user