samuelneff / MimeTypeMap

Provides a huge dictionary of file extensions to mime types.
MIT License
622 stars 201 forks source link

Added check to see if string contains a question mark #117

Closed ajtatum closed 3 years ago

ajtatum commented 3 years ago

Basically, if I'm trying to save a file from a URL, there may be query parameters after the file extension. So, we need to remove the query parameters so that we can get a valid file extension & mime type. Since question marks aren't allowed in file names or extensions, I figured it was unnecessary to do any further validations (like if the string was a URL or not).

ajtatum commented 3 years ago

Sorry it took so long to implement your suggestion. Take a look and let me know!

samuelneff commented 3 years ago

Thank you for your contribution!