1
0
mirror of https://github.com/osmarks/mycorrhiza.git synced 2024-12-05 02:29:54 +00:00

Fix /text/

This commit is contained in:
Timur Ismagilov 2022-02-06 18:14:49 +05:00 committed by Timur Ismagilov
parent 7fe232d742
commit 4890c21012

View File

@ -140,10 +140,12 @@ func handlerText(w http.ResponseWriter, rq *http.Request) {
hyphaName := util.HyphaNameFromRq(rq, "text")
switch h := hyphae.ByName(hyphaName).(type) {
case *hyphae.EmptyHypha:
default:
log.Println("Serving", h.TextPartPath())
w.Header().Set("Content-Type", "text/plain; charset=utf-8")
http.ServeFile(w, rq, h.TextPartPath())
case *hyphae.NonEmptyHypha:
if h.Kind() == hyphae.HyphaText {
log.Println("Serving", h.TextPartPath())
w.Header().Set("Content-Type", "text/plain; charset=utf-8")
http.ServeFile(w, rq, h.TextPartPath())
}
}
}