mirror of
https://github.com/go-gitea/gitea
synced 2025-07-16 07:18:37 +00:00
PDF-Previews in file-lists now working (#3000)
This commit is contained in:
@@ -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