mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-23 22:27:38 -05:00
Allow responseRecorder to be nil
This commit is contained in:
parent
2aa958e058
commit
082ae70d1d
1 changed files with 5 additions and 3 deletions
|
@ -53,9 +53,11 @@ func NewReplacer(r *http.Request, rr *responseRecorder) replacer {
|
||||||
"{when}": func() string {
|
"{when}": func() string {
|
||||||
return time.Now().Format(timeFormat)
|
return time.Now().Format(timeFormat)
|
||||||
}(),
|
}(),
|
||||||
"{status}": strconv.Itoa(rr.status),
|
}
|
||||||
"{size}": strconv.Itoa(rr.size),
|
if rr != nil {
|
||||||
"{latency}": time.Since(rr.start).String(),
|
rep["{status}"] = strconv.Itoa(rr.status)
|
||||||
|
rep["{size}"] = strconv.Itoa(rr.size)
|
||||||
|
rep["{latency}"] = time.Since(rr.start).String()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Header placeholders
|
// Header placeholders
|
||||||
|
|
Loading…
Reference in a new issue