1
0
Fork 0
mirror of https://github.com/Eggbertx/gochan.git synced 2025-09-16 07:56:24 -07:00

Correct extensions for video uploads (missing period at beginning)

This commit is contained in:
Eggbertx 2023-04-14 08:46:24 -07:00
parent eef1599024
commit 423dd25713
2 changed files with 5 additions and 3 deletions

View file

@ -145,17 +145,19 @@ func GetThumbnailExt(filename string) string {
switch ext {
case ".gif":
fallthrough
case ".mp4":
fallthrough
case ".png":
fallthrough
case ".webm":
fallthrough
case ".webp":
return "png"
case ".jfif":
fallthrough
case ".jpg":
fallthrough
case ".jpeg":
fallthrough
case "mp4":
return "jpg"
default:
// invalid file format

View file

@ -105,7 +105,7 @@ func AttachUploadFromRequest(request *http.Request, writer http.ResponseWriter,
Msg("Recovered from a panic in event handler")
}
if ext == "webm" || ext == "mp4" {
if ext == ".webm" || ext == ".mp4" {
infoEv.Str("post", "withVideo").
Str("filename", handler.Filename).
Str("referer", request.Referer()).Send()