diff options
| -rw-r--r-- | gopherproxy.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gopherproxy.go b/gopherproxy.go index 0134f88..6490b28 100644 --- a/gopherproxy.go +++ b/gopherproxy.go | |||
| @@ -143,7 +143,9 @@ func GopherHandler(tpl *template.Template, robotsdata *robotstxt.RobotsData, ass | |||
| 143 | } | 143 | } |
| 144 | 144 | ||
| 145 | if res.Body != nil { | 145 | if res.Body != nil { |
| 146 | if len(parts) >= 2 && parts[1] == "0" { //strings.HasSuffix(uri, ".txt") || strings.HasSuffix(uri, ".md") { | 146 | if len(parts) < 2 { |
| 147 | io.Copy(w, res.Body) | ||
| 148 | } else if parts[1] == "0" { //strings.HasSuffix(uri, ".txt") || strings.HasSuffix(uri, ".md") { | ||
| 147 | // handle .txt files | 149 | // handle .txt files |
| 148 | buf := new(bytes.Buffer) | 150 | buf := new(bytes.Buffer) |
| 149 | buf.ReadFrom(res.Body) | 151 | buf.ReadFrom(res.Body) |
