Skip to content

Commit 2644a98

Browse files
committed
lowercase urlFileName before checking suffixes
1 parent c04e604 commit 2644a98

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

grab.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ func validateImageURL(fullURL string) (string, error) {
135135
urlFileName := segments[len(segments)-1]
136136
allowedImageExtensions := []string{".jpg", ".jpeg", ".png"}
137137
for _, suffix := range allowedImageExtensions {
138-
if strings.HasSuffix(urlFileName, suffix) {
138+
if strings.HasSuffix(strings.ToLower(urlFileName), suffix) {
139139
return urlFileName, nil
140140
}
141141

0 commit comments

Comments
 (0)