-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.is('xml') not accepting text/xml #617
Comments
Hmm ideally mime-db so we don't have to special-case anything in here. |
@dougwilson would know better. is you could also try |
It is a valid type, but the limitation is that type-is, when given a file extension like "xml" just does a lookup in mime-types, which itself has a limitation of just the file extension to the "best fit" type, which is application/xml, the current official universal type for xml. It is on the backlog to provide a list, but in order to do that, the issues in mime-db need to be resolved so that things like mime-types can return arrays in the proper preferred order when inverting the lookup map. |
@jstans i'm closing this. here's the relevant issues list: https://github.com/jshttp/mime-db/issues thanks! |
I noticed that this.request.is('xml') would return false on a content-type of text/xml but not application/xml, leading many libraries which rely on using this functionality to detect xml to not work when the text/xml content-type is used.
I've done some inspection and it appears this is coming from the mime-types library, which only returns a single match for an extension which can exist multiple times in mime-db.
Should a solution to this be looked at, or should libraries be updated to check for both application/xml and text/xml?
The text was updated successfully, but these errors were encountered: