josevalim
Hi everyone,
I have started working on the v2 version of the Mime library, used by Plug and Phoenix. The previous version depended on an external Mime database, which made it complicated for us to handle corner cases and, often times, it was too large.
The new version starts a new database from scratch, which should be faster to compile, faster to run, and use less memory. However, it may be missing important mime types. Therefore, I would like to request the community help in two possible ways:
-
Compare the list of supported extensions with the files you have in priv/static (or assets/static). Are all extensions listed? If not, please send a PR to add unsupported extensions.
-
Use mime master as a dependency in your project and see if anything fails:
{:mime, "~> 2.0", github: "elixir-plug/mime", override: true}
Your feedback is deeply appreciated!
Trending in Announcing
Other Trending Topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #ai
- #elixirconf-us
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming











Showing Posts 15 to 6- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
josevalim
Hrm, so we need to see how the mime types are being parsed by Plug. Perhaps it rejects or discards what is after the question mark.
altdsoy
Yes, I did. Double checked ervery time. Running after each change:
mix deps.clean mime --buildThe MIME that is using the semicolon separated version does not work (I mean the
plug :accepts, ["v1"]errors kicks in with a 406 response (which is the expected behavior for a not compatible type, right?)The one without the semicolon works as expected.
josevalim
Just to be sure: did you force MIME to be recompiled so it picks your changes?
altdsoy
Hello José, did you mean setting the types in the
config :mime, :types(as it’s suppose to be done)?Maybe, I was a bit confusing, sorry for that. I meant that I was able to define my own type using the following:
However, It seems that the below version does not work, and it was basically my question (just wanted to be sure it doesn’t work as a MIME type):
The way I tested it was to using a
plug :acceptsand it’s only working without the;version=1.Anyway, thank you for your time.
josevalim
There is a mechanism for you to define additional types. I think you will need to define each version as its own mime type.
altdsoy
Hello!
Does it handle custom MIME with versioning?
For example, the both example below are valid values:
However, it seems the second one is not working with
MIME… Or maybe I’m doing something wrong?josevalim
Thanks for the follow up and don’t worry about this.
Get better!
BartOtten
Got RSI, so spend so time off keyboard, hence the late reply.
Did not encounter any issues with importing it as a dep; didn’t find any files in priv/static not listed.
Found a small list in my code (which only checks for ‘zip’, image’ and ‘xml’) with a few Mime-types returned in content-type header. Those may not be ‘standard’ (hence my custom list) but maybe they are used more often. The mentioned RSI prevents me from investigating.
f0rest8
On my phone so apologies if I’m missing it, but is the InDesign file extension
.indincluded?I see the .ps, .eps, .ai but I haven’t noticed the .ind yet.
Again, I’m on my phone so I might just be missing it when I look.
Update: maybe .ind was never supported and the preference is just to use .ai?
josevalim
Please send a PR so text/javascript prevails but we should still recognize other formats.