I'm trying to use Karate to check the behavior of our server when paths contain multiple slashes, so I have a test like
Scenario: Multiple slashes
* url 'http://localhost'
Given path '///some//path///'
When method get
Then status 404
When running this, the Karate output/log contains all the slashes:
12:04:52.307 [pool-1-thread-1] DEBUG com.intuit.karate - request:
1 > GET http://localhost///some//path///
1 > Host: localhost
But according to the server log (simply using Apache for this demo), the actual request just has single slashes:
127.0.0.1 - - [23/Aug/2021:12:04:52 +0200] "GET /some/path/ HTTP/1.1" 404 488 "-" "Apache-HttpClient/4.5.13 (Java/11.0.4)"
So I have several questions:
- Is that slash normalization the expected (and documented?) behavior?
- Can I switch it off somewhere?
- If the slashes are collapsed, shouldn't the log contain the actual (normalized) request, so that I see what's really sent to the server?