mirror of
https://codeberg.org/davrot/forgejo.git
synced 2025-05-25 12:00:01 +02:00
PDF-Previews in file-lists now working (#3000)
This commit is contained in:
parent
0325bec283
commit
3df8eb60e3
95 changed files with 64456 additions and 1 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue