]> source.dussan.org Git - gitea.git/commit
Do not recognize text files as audio (#23355) (#23368)
authorGiteabot <teabot@gitea.io>
Wed, 8 Mar 2023 08:03:05 +0000 (03:03 -0500)
committerGitHub <noreply@github.com>
Wed, 8 Mar 2023 08:03:05 +0000 (16:03 +0800)
commitcf80f829b49b35fd91854798f9ead913145782f1
treeb77d5eedd32a9dae77cdfa2a8476c2d495f971b0
parented25e094abfc93e83c6fecb5d82ce64d0e220717
Do not recognize text files as audio (#23355) (#23368)

Backport #23355

Close #17108

This PR uses a trick (removing the ID3 tag) to detect the content again
to to see whether the content is text type.

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: delvh <dev.lh@web.de>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
modules/typesniffer/typesniffer.go
modules/typesniffer/typesniffer_test.go