docs.rs
docs.rs copied to clipboard
potential wrong mime types in our storage
coming from #2040 and the comments by @Nemo157
The question I have is how did an invalid mimetype get into S3, and I probably found the answer with a little more looking, it's an old crate built in 2017 back when https://docs.rs/magic was used for mimetype detection, I'm not surprised it may have put some invalid data into the database back then.
and
(This does make me question our current default of
text/plainwhen mime detection fails while adding a file though) https://github.com/rust-lang/docs.rs/blob/c927eac0497baa99d13e9f58e0666021affb8f68/src/storage/mod.rs#L549-L551
We might have:
- wrong mime-types / invalid data for old crates, when
magicwas used. - a
text/plaindefault set whenmime_guessdoesn't give us anything, whereapplication/octet-streammight be the better default? ( to be discussed)