Since the chi upgrade if the templates are missing an endless loop will occur if
status/500.tmpl is missing.
Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
return fmt.Sprint(time.Since(startTime).Nanoseconds()/1e6) + "ms"
}
if err := ctx.Render.HTML(ctx.Resp, status, string(name), ctx.Data); err != nil {
+ if status == http.StatusInternalServerError && name == base.TplName("status/500") {
+ ctx.PlainText(http.StatusInternalServerError, []byte("Unable to find status/500 template"))
+ return
+ }
ctx.ServerError("Render failed", err)
}
}