parker89 opened a new pull request, #927:
URL: https://github.com/apache/httpcomponents-client/pull/927

   Follow-up to #915. `RequestSupport#extractPathPrefix` currently treats any 
`.` in the path as needing normalization, so paths with dotted segments or file 
extensions (`/packages/com.example.service/versions/1.2.3`, 
`/files/report.csv`) still go through segment decoding, dot segment removal and 
re-encoding.
   
   A `.` can only begin a dot segment if it is the first character of a 
segment, so this only flags a `.` that follows a `/` or starts the path. Dots 
anywhere else can't change the result.
   
   The output is unchanged. The existing tests pass, and I added tests for dots 
inside segments as well as for dot segments that still have to be normalized 
(`/./`, a trailing `.`, `%2E%2E` and a leading `../`). I also compared it with 
the current implementation on 200k generated paths starting with `/` and got 
identical results.
   
   JMH, JDK 21, average time and `gc.alloc.rate.norm`:
   
   | Request target | master ns/op | this ns/op | master B/op | this B/op |
   |---|---:|---:|---:|---:|
   | `/api/v1/packages/com.example.service/versions/1.2.3?...` (3 params) | 
1,308 | 106 (-92%) | 3,136 | 184 (-94%) |
   | `/api/v2/datasets/<uuid>/files/report.csv?...` (3 params) | 1,571 | 135 
(-91%) | 3,352 | 216 (-94%) |
   | paths without dots (no query, 3, 6 and 10 params) | 40-140 | unchanged | 
56-216 | unchanged |
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to