-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TT-7129] Fix setting global_size_limit not enabling RequestSizeLimitMiddleware #3979
[TT-7129] Fix setting global_size_limit not enabling RequestSizeLimitMiddleware #3979
Conversation
Nice one! Keen to add a small test for it? It can look like this: func TestValidateJSONSchema(t *testing.T) {
ts := StartTest(nil)
defer ts.Close()
ts.Gw.BuildAndLoadAPI(func(spec *APISpec) {
UpdateAPIVersion(spec, "v1", func(v *apidef.VersionInfo) {
v.GlobalSizeLimit = 1
})
})
ts.Run(t, []test.TestCase{
{Method: "POST", Path: "/sample/", Data: "foobar", Code: http.StatusBadRequest},
}...)
} |
I've added a small test for this. Thank you very much for the pretty much finished test snippet! |
Everything LGTM, please rebase and check the test failures. |
8219774
to
1111195
Compare
I've rebased the branch onto the current master. |
I believe the tests on master have been resolved. Can I ask you for the hopefully last rebase? The teams are improving the test case failures, so your best case at merging this soon is unfortunately rebasing until tests pass 😬 |
1111195
to
47b0dd1
Compare
47b0dd1
to
1cb0272
Compare
1cb0272
to
6fd80f3
Compare
https://tyktech.atlassian.net/browse/TT-7129 Closes #2887 #3979 --------- Co-authored-by: Patrick Taibel <[email protected]>
I've cherry-picked this over #4967 - your contribution will be included in the 5.1 release. Thank you 🏆 |
https://tyktech.atlassian.net/browse/TT-7129 Closes #2887 #3979 --------- Co-authored-by: Patrick Taibel <[email protected]> (cherry picked from commit 19e3137)
https://tyktech.atlassian.net/browse/TT-7129 Closes #2887 #3979 --------- Co-authored-by: Patrick Taibel <[email protected]> (cherry picked from commit 19e3137)
[TT-7129] Fix global size limit (#4967) https://tyktech.atlassian.net/browse/TT-7129 Closes #2887 #3979 --------- Co-authored-by: Patrick Taibel <[email protected]>
[TT-7129] Fix global size limit (#4967) https://tyktech.atlassian.net/browse/TT-7129 Closes #2887 #3979 --------- Co-authored-by: Patrick Taibel <[email protected]>
Description
Fix
EnabledForSpec
inRequestSizeLimitMiddleware
for API global limits without size limits inextended_paths
.Related Issue
#3977
Motivation and Context
Makes the
RequestSizeLimitMiddleware
usable when only API global limits are specified.Types of changes
Checklist
fork, don't request your
master
!master
branch (left side). Also, you should startyour branch off our latest
master
.go mod tidy && go mod vendor
go fmt -s
go vet