forgejo/modules/typesniffer
Gusted e57089a037
[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

(cherry picked from commit dbaf3eb13c)
(cherry picked from commit 93bf9cc939)
2023-08-07 11:05:22 +02:00
..
typesniffer.go [GITEA] Recognize OGG as an audio format 2023-08-07 11:05:22 +02:00
typesniffer_test.go [GITEA] Recognize OGG as an audio format 2023-08-07 11:05:22 +02:00