Response size clamp (#786)

*) Limit response http body or json response size to FN_MAX_RESPONSE_SIZE (default unlimited)
*) If limits are exceeded 502 is returned with 'body too large' in the error message
This commit is contained in:
Tolga Ceylan
2018-03-01 17:14:50 -08:00
committed by GitHub
parent a30c2c8f1b
commit 89a1fc7c72
7 changed files with 92 additions and 18 deletions

View File

@@ -169,6 +169,7 @@ func (li *lineWriter) Close() error {
}
// io.Writer that allows limiting bytes written to w
// TODO change to use clamp writer, this is dupe code
type limitWriter struct {
n, max int
io.Writer