tyk icon indicating copy to clipboard operation
tyk copied to clipboard

RequestSizeLimitMiddleware not working with only global size limits

Open PatrickTaibel opened this issue 2 years ago • 0 comments

Branch/Environment/Version

  • Branch/Version: master
  • Environment: On-prem

Describe the bug RequestSizeLimitMiddleware does not work when only setting the global size limits on APIs. The activation detection (EnabledForSpec) does only care about the configuration in extended_paths.

Reproduction steps Steps to reproduce the behavior:

  1. Add any API using the global_size_limit without specify any size_limits in extended_paths
  2. Make a request that exceeds the configured limit

Actual behavior RequestSizeLimitMiddleware gets not activated when setting global_size_limit. Therefore, no limit gets applied.

Expected behavior The specified limit is applied to the incoming requests.

Additional context Check for global_size_limit is missing: https://github.com/TykTechnologies/tyk/blob/1d0190d987cde6de13b50e75ab413262aa628b24/gateway/mw_request_size_limit.go#L23-L30

PatrickTaibel avatar Mar 31 '22 14:03 PatrickTaibel