Skip to content

Commit

Permalink
Merge branch 'fix/url-encoding' of github.com:michaelwolz/capacitor i…
Browse files Browse the repository at this point in the history
…nto fix/url-encoding
  • Loading branch information
michaelwolz committed Jun 21, 2024
2 parents 088fb1a + 6c4e22d commit b766f03
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion android/capacitor/src/main/assets/native-bridge.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ var nativeBridge = (function (exports) {
if (isRelativeOrProxyUrl(url))
return url;
const bridgeUrl = new URL((_b = (_a = win.Capacitor) === null || _a === void 0 ? void 0 : _a.getServerUrl()) !== null && _b !== void 0 ? _b : '');
bridgeUrl.pathname = `${CAPACITOR_HTTP_INTERCEPTOR}`;
bridgeUrl.pathname = CAPACITOR_HTTP_INTERCEPTOR;
// URLSearchParams `append()` method will automatically percent encode the url
bridgeUrl.searchParams.append(CAPACITOR_HTTP_INTERCEPTOR_URL_PARAM, url);
return bridgeUrl.toString();
Expand Down
2 changes: 1 addition & 1 deletion core/native-bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ const isRelativeOrProxyUrl = (url: string | undefined): boolean =>
const createProxyUrl = (url: string, win: WindowCapacitor): string => {
if (isRelativeOrProxyUrl(url)) return url;
const bridgeUrl = new URL(win.Capacitor?.getServerUrl() ?? '');
bridgeUrl.pathname = `${CAPACITOR_HTTP_INTERCEPTOR}`;
bridgeUrl.pathname = CAPACITOR_HTTP_INTERCEPTOR;
// URLSearchParams `append()` method will automatically percent encode the url
bridgeUrl.searchParams.append(CAPACITOR_HTTP_INTERCEPTOR_URL_PARAM, url);

Expand Down
2 changes: 1 addition & 1 deletion ios/Capacitor/Capacitor/assets/native-bridge.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ var nativeBridge = (function (exports) {
if (isRelativeOrProxyUrl(url))
return url;
const bridgeUrl = new URL((_b = (_a = win.Capacitor) === null || _a === void 0 ? void 0 : _a.getServerUrl()) !== null && _b !== void 0 ? _b : '');
bridgeUrl.pathname = `${CAPACITOR_HTTP_INTERCEPTOR}`;
bridgeUrl.pathname = CAPACITOR_HTTP_INTERCEPTOR;
// URLSearchParams `append()` method will automatically percent encode the url
bridgeUrl.searchParams.append(CAPACITOR_HTTP_INTERCEPTOR_URL_PARAM, url);
return bridgeUrl.toString();
Expand Down

0 comments on commit b766f03

Please sign in to comment.