My goal is to fetch a URL that ends with a dot-segment, so a URL that ends with a literal dot/period: .
Example:
I expected the following invocation of fetch to result in an HTTP GET request on the base URI of the site with the path /api/users/. (notice the literal dot at the end)
await fetch("/api/users/.")
Instead, it results in the path <base URI>/api/users/ to be requested (notice the missing dot)
This section of RFC 3986 describes the behaviour to remove dot-segments: https://datatracker.ietf.org/doc/html/rfc3986#section-5.2.4
Now, I tried to URI-escape the dot with %2e, giving me the following request path: /api/users/%2e
Unfortunately, the same behaviour occurs, tested on Firefox and on Chrome.
I am baffled how to achieve this in a Browser-based environment using the Browser's fetch API.
I know that using cURL this is as easy as specifying an additional parameter (otherwise the same behaviour occurs also using cURL):
curl --path-as-is "http://localhost:8080/api/users/."
However, I have not found any such config possibility for fetch.