fix application bug
This commit is contained in:
5
vendor/github.com/mholt/caddy/caddyhttp/markdown/markdown.go
generated
vendored
5
vendor/github.com/mholt/caddy/caddyhttp/markdown/markdown.go
generated
vendored
@@ -17,6 +17,7 @@
|
||||
package markdown
|
||||
|
||||
import (
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
"path"
|
||||
@@ -168,7 +169,9 @@ func (md Markdown) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, error
|
||||
w.Header().Set("Content-Length", strconv.Itoa(len(html)))
|
||||
httpserver.SetLastModifiedHeader(w, lastModTime)
|
||||
if r.Method == http.MethodGet {
|
||||
w.Write(html)
|
||||
if _, err := w.Write(html); err != nil {
|
||||
log.Println("[ERROR] failed to write html response: ", err)
|
||||
}
|
||||
}
|
||||
return http.StatusOK, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user