aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFeuerfuchs <git@feuerfuchs.dev>2019-06-21 15:46:45 +0200
committerFeuerfuchs <git@feuerfuchs.dev>2019-06-21 15:46:45 +0200
commit113b0b3d8e1345ec740cad8115f1e74c5b0eca05 (patch)
tree973825929c46778ddfddc1a0954ebc61a97db006
parentForgot to compile stylesheet (diff)
downloadgopherproxy-113b0b3d8e1345ec740cad8115f1e74c5b0eca05.tar.gz
gopherproxy-113b0b3d8e1345ec740cad8115f1e74c5b0eca05.tar.bz2
gopherproxy-113b0b3d8e1345ec740cad8115f1e74c5b0eca05.zip
Check type instead of file ext to render text via tpl
-rw-r--r--gopherproxy.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/gopherproxy.go b/gopherproxy.go
index 8ba515e..11c08d5 100644
--- a/gopherproxy.go
+++ b/gopherproxy.go
@@ -132,7 +132,7 @@ func GopherHandler(tpl *template.Template, robotsdata *robotstxt.RobotsData, rob
132 } 132 }
133 133
134 if res.Body != nil { 134 if res.Body != nil {
135 if strings.HasSuffix(uri, ".txt") || strings.HasSuffix(uri, ".md") { 135 if len(parts) >= 2 && parts[1] == "0" { //strings.HasSuffix(uri, ".txt") || strings.HasSuffix(uri, ".md") {
136 // handle .txt files 136 // handle .txt files
137 buf := new(bytes.Buffer) 137 buf := new(bytes.Buffer)
138 buf.ReadFrom(res.Body) 138 buf.ReadFrom(res.Body)