From 1131fca16a227140dd3e728ec7249f34f224a569 Mon Sep 17 00:00:00 2001 From: Noah 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":