Skip to content

Conversation

@JanStevens
Copy link
Contributor

πŸ”— Linked issue

#72

❓ Type of change

  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Performs the extension validation check without looking at the case by always applying lowercase to the passed in allowed extensions and the file extension itself that needs to be validated.

It improves ergonomics for a developer so we don't have to do things like: png, PNG, jpg, JPG. In the end if you want to allow png you probably also want to allow PNG.

This can be seen as a breaking change but I suspect the impact will be minimal.

Resolves #72

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@thetutlage
Copy link
Member

Can we instead normalize the file extension name at the source? Meaning, when we compute the extension we always convert it to lowercase in the following methods.

@JanStevens
Copy link
Contributor Author

Can we instead normalize the file extension name at the source? Meaning, when we compute the extension we always convert it to lowercase in the following methods.

Thanks for the suggestion! I've applied the requested changes and updated the new tests to reflect the changes.

@thetutlage
Copy link
Member

Wonderful. Now, we guarantee that file.extname will always be normalized beyond validations as well

@thetutlage thetutlage merged commit 937ccc0 into adonisjs:11.x Oct 14, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make extension validation case insensitive

2 participants