ctx.Resp.Header().Set("Content-Length", strconv.Itoa(len(xmlMetadataWithHeader)))
ctx.Resp.Header().Set("Content-Type", contentTypeXML)
- if _, err := ctx.Resp.Write(xmlMetadataWithHeader); err != nil {
- log.Error("write bytes failed: %v", err)
- }
+ _, _ = ctx.Resp.Write(xmlMetadataWithHeader)
}
func servePackageFile(ctx *context.Context, params parameters, serveContent bool) {
b.Resp.Header().Set("Content-Type", "text/plain;charset=utf-8")
b.Resp.Header().Set("X-Content-Type-Options", "nosniff")
b.Resp.WriteHeader(status)
- if _, err := b.Resp.Write(bs); err != nil {
- log.ErrorWithSkip(skip, "plainTextInternal (status=%d): write bytes failed: %v", status, err)
- }
+ _, _ = b.Resp.Write(bs)
}
// PlainTextBytes renders bytes as plain text
"path"
"strconv"
"strings"
+ "syscall"
"time"
user_model "code.gitea.io/gitea/models/user"
}
err := ctx.Render.HTML(ctx.Resp, status, string(name), ctx.Data, ctx.TemplateContext)
- if err == nil {
+ if err == nil || errors.Is(err, syscall.EPIPE) {
return
}