Merge ee497af18090df71c4a5c31218abf4c1a7e18689 into c3d1092b3b48addf6f9cd00fe274ec3bd14650eb

This commit is contained in:
Sanbei 2025-10-11 21:19:01 +08:00 committed by GitHub
commit 9402432939
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2989,7 +2989,7 @@ func TestHasRequestContext(t *testing.T) {
assert.False(t, c.hasRequestContext(), "no request, has fallback")
c.Request, _ = http.NewRequest(http.MethodGet, "/", nil)
assert.True(t, c.hasRequestContext(), "has request, has fallback")
c.Request, _ = http.NewRequestWithContext(nil, "", "", nil) //nolint:staticcheck
c.Request, _ = http.NewRequestWithContext(context.TODO(), "", "", nil) //nolint:staticcheck
assert.False(t, c.hasRequestContext(), "has request with nil ctx, has fallback")
c.engine.ContextWithFallback = false
assert.False(t, c.hasRequestContext(), "has request, no fallback")