mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-02 17:20:53 +02:00
PDF-Previews in file-lists now working (#3000)
This commit is contained in:
1 parent
0325bec283
commit
3df8eb60e3
95 files changed
+64456
-1
No files matched your search
@@ -522,3 +522,11 @@ func IsImageFile(data []byte) (string, bool) {
|
||||
}
|
||||
return contentType, false
|
||||
}
|
||||
|
||||
func IsPDFFile(data []byte) (string, bool) {
|
||||
contentType := http.DetectContentType(data)
|
||||
if strings.Index(contentType, "application/pdf") != -1 {
|
||||
return contentType, true
|
||||
}
|
||||
return contentType, false
|
||||
}
|
||||
Reference in new issue
Block a user