capacitor icon indicating copy to clipboard operation
capacitor copied to clipboard

Fix percent-encoding for patched fetch / xhr requests

Open michaelwolz opened this issue 1 year ago • 0 comments

Following up #7523.

This suggestion addresses the issue of non-encoded URLs in patched fetch and XHR requests. By encoding the full original URL and appending it as a parameter to the bridge/proxy URL, this solution should be more robust when passed to the native code. Also, there is no longer a need to distinguish between HTTP and HTTPS URLs separately, as this information is already embedded in the encoded URL parameter.

Working test implementation can be found here (including an example with non 80 port): https://github.com/michaelwolz/capacitor-tests/tree/fix/url-encoding

michaelwolz avatar Jun 20 '24 17:06 michaelwolz