It's be great to add a comment here to explain why we strip `index.html`. We do remove the `index.html` once there is nothing else at the end of the URL string, it'd be great to include that into the doc (why we do that).
Also we can probably add tests for cases like `[URL] to verify that we do not remove `index.html` if it's in the GET params part of the URL.