From 13aa5a8544ece2d76974e52e6e5fb7c225a385ee Mon Sep 17 00:00:00 2001 From: Noah Petherbridge Date: Mon, 22 Aug 2022 19:29:48 -0700 Subject: [PATCH] Photo uploads: make file extension check case-insensitive --- pkg/photo/upload.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/photo/upload.go b/pkg/photo/upload.go index 5b0f4de..348e131 100644 --- a/pkg/photo/upload.go +++ b/pkg/photo/upload.go @@ -35,8 +35,8 @@ type UploadConfig struct { // - error on errors func UploadPhoto(cfg UploadConfig) (string, string, error) { // Validate and normalize the extension. - var extension = cfg.Extension - switch cfg.Extension { + var extension = strings.ToLower(cfg.Extension) + switch extension { case ".jpg": fallthrough case ".jpe":