mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
move max_request_size from agent to server (#1145)
moves the config option for max request size up to the front end, adds the env var for it there, adds a server test for it and removes it from agent. a request is either gonna come through the lb (before grpc) or to the server, we can handle limiting the request there at least now, which may be easier than having multiple layers of request body checking. this aligns with not making the agent as responsible for http behaviors (eventually, not at all once route is fully deprecated).
This commit is contained in:
@@ -122,6 +122,9 @@ const (
|
||||
// EnvLBPlacementAlg is the algorithm to place fn calls to fn runners in lb.[0w
|
||||
EnvLBPlacementAlg = "FN_PLACER"
|
||||
|
||||
// EnvMaxRequestSize sets the limit in bytes for any API request's length.
|
||||
EnvMaxRequestSize = "FN_MAX_REQUEST_SIZE"
|
||||
|
||||
// DefaultLogLevel is info
|
||||
DefaultLogLevel = "info"
|
||||
|
||||
@@ -249,6 +252,7 @@ func NewFromEnv(ctx context.Context, opts ...Option) *Server {
|
||||
opts = append(opts, WithNodeCert(getEnv(EnvCert, "")))
|
||||
opts = append(opts, WithNodeCertKey(getEnv(EnvCertKey, "")))
|
||||
opts = append(opts, WithNodeCertAuthority(getEnv(EnvCertAuth, "")))
|
||||
opts = append(opts, LimitRequestBody(int64(getEnvInt(EnvMaxRequestSize, 0))))
|
||||
|
||||
publicLBURL := getEnv(EnvPublicLoadBalancerURL, "")
|
||||
if publicLBURL != "" {
|
||||
|
||||
Reference in New Issue
Block a user