Skip to content

Commit

Permalink
lowercase urlFileName before checking suffixes
Browse files Browse the repository at this point in the history
  • Loading branch information
bbkane committed Mar 12, 2024
1 parent c04e604 commit 2644a98
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion grab.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ func validateImageURL(fullURL string) (string, error) {
urlFileName := segments[len(segments)-1]
allowedImageExtensions := []string{".jpg", ".jpeg", ".png"}
for _, suffix := range allowedImageExtensions {
if strings.HasSuffix(urlFileName, suffix) {
if strings.HasSuffix(strings.ToLower(urlFileName), suffix) {
return urlFileName, nil
}

Expand Down

0 comments on commit 2644a98

Please sign in to comment.