tyk
tyk copied to clipboard
RequestSizeLimitMiddleware not working with only global size limits
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:
- Add any API using the
global_size_limit
without specify anysize_limits
inextended_paths
- 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