Photo uploads: make file extension check case-insensitive

forums
Noah 2022-08-22 19:29:48 -07:00
parent e80d4e6ad6
commit 13aa5a8544
1 changed files with 2 additions and 2 deletions

View File

@ -35,8 +35,8 @@ type UploadConfig struct {
// - error on errors // - error on errors
func UploadPhoto(cfg UploadConfig) (string, string, error) { func UploadPhoto(cfg UploadConfig) (string, string, error) {
// Validate and normalize the extension. // Validate and normalize the extension.
var extension = cfg.Extension var extension = strings.ToLower(cfg.Extension)
switch cfg.Extension { switch extension {
case ".jpg": case ".jpg":
fallthrough fallthrough
case ".jpe": case ".jpe":