Sorry, but I cannot make a "reduced test case" due to a difficulty to create a test scenario.
I'm using an MVC approach so I have managed code on server side, and url are slugified, so I don't have file extensions.
In a webpage I've implemented a simple paging mechanism that use query string parameter, whenever an ajax GET is performed, managed code return HTML of desired page, and lastly following (for instance):
<a class="pagination__next" href="?p=2"></a>
so if actual URL path is something like /category/products, I'm expecting a GET like /category/products?p=2, instead I'm getting a GET like /gategory/?p=2 which is bad!
I think this issue is caused by getPath function that returns a substring until last '/' in URL's path.