diff --git a/package.json b/package.json index e780869..e27fc4c 100644 --- a/package.json +++ b/package.json @@ -94,7 +94,7 @@ "@auth0/auth0-spa-js": "^2.0.4", "@azure/msal-browser": "^2.38.0", "@babel/runtime": "^7.17.9", - "@openziti/ziti-browzer-core": "^0.26.0", + "@openziti/ziti-browzer-core": "^0.27.0", "bowser": "^2.11.0", "cookie-interceptor": "^1.0.0", "core-js": "^3.22.8", diff --git a/src/runtime.js b/src/runtime.js index 12fd8dd..411200d 100644 --- a/src/runtime.js +++ b/src/runtime.js @@ -2209,37 +2209,9 @@ const zitiFetch = async ( url, opts ) => { if (isUndefined(serviceName)) { // If we have no serviceConfig associated with the hostname:port - let routeOverCORSProxy = zitiBrowzerRuntime.zitiContext.shouldRouteOverCORSProxy( url ); - - if (routeOverCORSProxy) { // If hostname:port is something we need to CORS Proxy - - zitiBrowzerRuntime.logger.warn('zitiFetch(): doing CORS Proxying of [%s]', url); - - let corsTargetHostname = newUrl.hostname; - let corsTargetPort = newUrl.port; - if (corsTargetPort === '') { - if (newUrl.protocol === 'https:') { - corsTargetPort = '443'; - } else { - corsTargetPort = '80'; - } - } - - let corsTargetPathname = newUrl.pathname; - newUrl.hostname = window.zitiBrowzerRuntime.zitiConfig.browzer.bootstrapper.self.host; - newUrl.port = 443; - newUrl.pathname = '/ziti-cors-proxy/' + corsTargetHostname + ':' + corsTargetPort + corsTargetPathname; - zitiBrowzerRuntime.logger.warn( 'zitiFetch: transformed URL: ', newUrl.toString()); - - return window._ziti_realFetch(newUrl, opts); // Send special request to HTTP Agent - - } else { - - zitiBrowzerRuntime.logger.warn('zitiFetch(): no associated serviceConfig, bypassing intercept of [%s]', url); - return window._ziti_realFetch(url, opts); + zitiBrowzerRuntime.logger.warn('zitiFetch(): no associated serviceConfig, bypassing intercept of [%s]', url); + return window._ziti_realFetch(url, opts); - } - } } diff --git a/yarn.lock b/yarn.lock index 9b79e05..c2fdb43 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1195,10 +1195,10 @@ "@types/emscripten" "^1.39.6" "@wasmer/wasi" "^1.0.2" -"@openziti/ziti-browzer-core@^0.26.0": - version "0.26.0" - resolved "https://registry.yarnpkg.com/@openziti/ziti-browzer-core/-/ziti-browzer-core-0.26.0.tgz#0d53acf2d1f312f68cc7047d1bc467c68e935d0d" - integrity sha512-T/aeKT/SoLNoWoG7UBDlUd/h2aqqvYDdYPB0xFEvkFo+oicair6IZwZEL19wY7spKyjMWAklY59vTcMiSOoMbw== +"@openziti/ziti-browzer-core@^0.27.0": + version "0.27.0" + resolved "https://registry.yarnpkg.com/@openziti/ziti-browzer-core/-/ziti-browzer-core-0.27.0.tgz#413e6de182f91a183346dcfb707f2de744ae6f07" + integrity sha512-hV+D+0KjrPEXZonaGjctlpfz65m7H8xpV8yuzfWqVrRJ4CRoXF+QLMeOuJdP5OlCyn3vUhvt7NTEAND92K6Rdw== dependencies: "@openziti/libcrypto-js" "^0.15.0" "@openziti/ziti-browzer-edge-client" "^0.6.2"