Fix REQUEST_URI when using a non-standard endpoint