Sample Spring Cloud Gateway application demonstrating issue #253
Suppose there's 3rd party accounting product as a service that allows to receive general ledger account journal entries for specified account. Account identifier can contain whitespaces.
SetPathIssueIntegrationSpec integration test demonstrates SetPath filter behaviour in case path contains characters that should be encoded (e.g. whitespace character). This test also demonstrates how this issue can be fixed by replacing decoded path with encoded. Same can be tested manually by:
- launching sample application by executing
./gradlew bootRunin project directory - Executing a request to route containing SetPath filter
curl -i -H "Accept: application/json" -X GET "http://127.0.0.1:8447/api/countries/se/accounting/accounts/2610%20(Deferred%20Income)/entries". HTTP status code 500 is returned. - Executing a request to route containing fixed SetPath filter
curl -i -H "Accept: application/json" -X GET "http://127.0.0.1:8447/api-fixed/countries/se/accounting/accounts/2610%20(Deferred%20Income)/entries". HTTP status code 200 and valid JSON payload is returned.