fix: avoid raw path redirect loops#4659
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4659 +/- ##
==========================================
- Coverage 99.21% 98.37% -0.84%
==========================================
Files 42 48 +6
Lines 3182 3139 -43
==========================================
- Hits 3157 3088 -69
- Misses 17 42 +25
- Partials 8 9 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
d2940af to
9477237
Compare
9477237 to
9395c62
Compare
|
I refreshed the branch against current The remaining |
Fixes #4034
This clears
URL.RawPathafterRedirectFixedPathrewritesURL.Path. Without that,URL.String()can keep emitting the original lowercase escaped raw path, so clients get redirected back to the same URL whenUseRawPathis enabled.The new regression covers the lowercase percent-encoded
/あcase and verifies the canonical uppercase escaped path is served without another redirect.Checklist:
masterTests:
go test -run TestRouteRedirectFixedPathmake testgo test ./...go vet ./....bin/golangci-lint run --verbose