guess mimetype
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Arnas Udovic 2023-06-28 08:10:07 +03:00
parent 0c5412c069
commit 509ae1968b
2 changed files with 9 additions and 3 deletions

View file

@ -7,10 +7,15 @@ My capsule in Gemini space. Built with zord-tree support
## TODO
* add image or other file not `gmi` download
* main.go:173 add content type by extension
* refactor layout
* remove capsule title from simple page
* security
* citata from some file
* add pagehint counter in abcex
* add gallery categories. index.md with secret to dynamic generators on build
__DONE__
* add image or other file not `gmi` download
* feed
* add category view
* add tag view

View file

@ -7,6 +7,8 @@ import (
"google.golang.org/grpc/credentials/insecure"
"io"
"log"
"mime"
"path"
"regexp"
"strings"
"time"
@ -169,8 +171,7 @@ func downloadAttachment(w gemini.ResponseWriter, r *gemini.Request, client TreeM
return
}
//w.SetMediaType(http.DetectContentType([]byte(response.Content)))
w.SetMediaType("image/png")
w.SetMediaType(mime.TypeByExtension(path.Ext(filePath)))
for {
chunkResponse, err := response.Recv()
if err == io.EOF {