-
Notifications
You must be signed in to change notification settings - Fork 583
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
feat: add media_types #2286
feat: add media_types #2286
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
FYI Luca and I worked together on a similar API last week, which resulted in #2276 (which only suggests |
Question about the module name: Should we call this Golang, for example, name the module |
MIME is an antiquated name for media types. When it was originally part of While it is less common it is the proper name for them (as there is no mail interchange going on here). From the page you linked to:
And the standard they are based on says:
So MIME is an extension to the e-mail protocol, a MIME type is when you use a media type with MIME and the |
Sounds fair enough to me |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Once upon a time deno.land/x/media_types was inside
std
but it was removed due to there being a debate about the API and I took over maintaining it.The PR intends to reverse this and will result in a series of PRs brining some of the common APIs common to handling HTTP requests into the std library.
@lucacasonato this includes the GoLang
mime
package APIs as well as some parts of thejshttp/mime-types
APIs thatdeno.land/x/media_types
was based on. It should provide an easy migration path for users ofdeno.land/x/media_types
but also provide more logical APIs aligned to what is in GoLang.Once this is landed, a subsequent PR should be created so the fileserver uses this instead of it partial mime db. I will also refactor oak and my other projects to use this as well.