forgejo/modules/typesniffer
Gusted dbaf3eb13c
[GITEA] Recognize OGG as an audio format
- OGG is officially an container format and is therefor classified as
`application/ogg` in RFC3534. While `audio/ogg` exists, as defined in
RFC5334, it doesn't have a different magic number and thus purely
informative, it can only be determined by parsing the file and checking
if it only contains audio data.
- A quick search on Wikimedia Commons yields that the OGG container is
by far more used for audio than for video, so it's safe to classify this
as audio, as OGG files that only contain video would now falsy be
classified as an audio file (previously it would've shown just a link to
the 'View Raw' link).
- Added unit tests.
- Resolves https://codeberg.org/forgejo/forgejo/issues/1091
2023-07-28 20:48:49 +02:00
..
typesniffer.go [GITEA] Recognize OGG as an audio format 2023-07-28 20:48:49 +02:00
typesniffer_test.go [GITEA] Recognize OGG as an audio format 2023-07-28 20:48:49 +02:00