Photo uploads: make file extension check case-insensitive
This commit is contained in:
parent
fb0e3651b0
commit
1131fca16a
|
@ -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":
|
||||||
|
|
Loading…
Reference in New Issue
Block a user