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

@@ -181,6 +181,10 @@ var (
error: fmt.Errorf("Cpus is invalid. Value should be either between [%.3f and %.3f] or [%dm and %dm] milliCPU units",
float64(MinMilliCPUs)/1000.0, float64(MaxMilliCPUs)/1000.0, MinMilliCPUs, MaxMilliCPUs),
}
ErrFunctionResponseTooBig = err{
code: http.StatusBadGateway,
error: fmt.Errorf("function response too large"),
}
)
// APIError any error that implements this interface will return an API response