Skip to content

Commit

Permalink
fix(http): set port for proxy url (#7341)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcesarmobile committed Mar 14, 2024
1 parent d7b23f2 commit a3059dc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion android/capacitor/src/main/assets/native-bridge.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ var nativeBridge = (function (exports) {
const originalHost = encodeURIComponent(proxyUrl.host);
const originalPathname = proxyUrl.pathname;
proxyUrl.protocol = bridgeUrl.protocol;
proxyUrl.host = bridgeUrl.host;
proxyUrl.hostname = bridgeUrl.hostname;
proxyUrl.port = bridgeUrl.port;
proxyUrl.pathname = `${isHttps ? CAPACITOR_HTTPS_INTERCEPTOR : CAPACITOR_HTTP_INTERCEPTOR}/${originalHost}${originalPathname}`;
return proxyUrl.toString();
};
Expand Down
3 changes: 2 additions & 1 deletion core/native-bridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ const createProxyUrl = (url: string, win: WindowCapacitor): string => {
const originalHost = encodeURIComponent(proxyUrl.host);
const originalPathname = proxyUrl.pathname;
proxyUrl.protocol = bridgeUrl.protocol;
proxyUrl.host = bridgeUrl.host;
proxyUrl.hostname = bridgeUrl.hostname;
proxyUrl.port = bridgeUrl.port;
proxyUrl.pathname = `${
isHttps ? CAPACITOR_HTTPS_INTERCEPTOR : CAPACITOR_HTTP_INTERCEPTOR
}/${originalHost}${originalPathname}`;
Expand Down
3 changes: 2 additions & 1 deletion ios/Capacitor/Capacitor/assets/native-bridge.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ var nativeBridge = (function (exports) {
const originalHost = encodeURIComponent(proxyUrl.host);
const originalPathname = proxyUrl.pathname;
proxyUrl.protocol = bridgeUrl.protocol;
proxyUrl.host = bridgeUrl.host;
proxyUrl.hostname = bridgeUrl.hostname;
proxyUrl.port = bridgeUrl.port;
proxyUrl.pathname = `${isHttps ? CAPACITOR_HTTPS_INTERCEPTOR : CAPACITOR_HTTP_INTERCEPTOR}/${originalHost}${originalPathname}`;
return proxyUrl.toString();
};
Expand Down

0 comments on commit a3059dc

Please sign in to comment.