fix #1669 write empty body panic error

This commit is contained in:
ysqi
2016-02-12 11:27:59 +08:00
parent 2b23764ee0
commit 810f6db8d2
3 changed files with 31 additions and 2 deletions

View File

@@ -21,7 +21,6 @@ import (
"errors"
"fmt"
"html/template"
"io"
"mime"
"net/http"
"path/filepath"
@@ -75,7 +74,7 @@ func (output *BeegoOutput) Body(content []byte) {
output.Status = 0
}
io.Copy(output.Context.ResponseWriter, buf)
output.Context.ResponseWriter.Copy(buf)
}
// Cookie sets cookie value via given key.