Add maxrequestbody directive (#1163)

This commit is contained in:
Ngo The Trung
2016-11-04 08:25:49 +08:00
committed by Tw
parent 63f749112b
commit 0cdaaba4b8
9 changed files with 438 additions and 2 deletions

View File

@ -268,7 +268,9 @@ func (r *replacer) getSubstitution(key string) string {
}
_, err := ioutil.ReadAll(r.request.Body)
if err != nil {
return r.emptyValue
if _, ok := err.(MaxBytesExceeded); ok {
return r.emptyValue
}
}
return requestReplacer.Replace(r.requestBody.String())
case "{status}":