fix image display
This commit is contained in:
parent
16cb1e974c
commit
346db02d89
3 changed files with 26 additions and 9 deletions
|
@ -51,6 +51,14 @@ func IsTextFile(data []byte) (string, bool) {
|
|||
return contentType, false
|
||||
}
|
||||
|
||||
func IsImageFile(data []byte) (string, bool) {
|
||||
contentType := http.DetectContentType(data)
|
||||
if strings.Index(contentType, "img/") != -1 {
|
||||
return contentType, true
|
||||
}
|
||||
return contentType, false
|
||||
}
|
||||
|
||||
func IsReadmeFile(name string) bool {
|
||||
name = strings.ToLower(name)
|
||||
if len(name) < 6 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue