Commit 082ae70d authored by Nimi Wariboko Jr's avatar Nimi Wariboko Jr

Allow responseRecorder to be nil

parent 2aa958e0
......@@ -53,9 +53,11 @@ func NewReplacer(r *http.Request, rr *responseRecorder) replacer {
"{when}": func() string {
return time.Now().Format(timeFormat)
}(),
"{status}": strconv.Itoa(rr.status),
"{size}": strconv.Itoa(rr.size),
"{latency}": time.Since(rr.start).String(),
}
if rr != nil {
rep["{status}"] = strconv.Itoa(rr.status)
rep["{size}"] = strconv.Itoa(rr.size)
rep["{latency}"] = time.Since(rr.start).String()
}
// Header placeholders
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment