npm package diff
Package: @forge/tunnel
Versions: 5.10.1-next.9 - 5.10.1-next.10
File: package/out/servers/resource-tunnel-server.js
Index: package/out/servers/resource-tunnel-server.js
===================================================================
--- package/out/servers/resource-tunnel-server.js
+++ package/out/servers/resource-tunnel-server.js
@@ -49,13 +49,17 @@
.if((res) => /html/i.test(res.get('content-type')))
.replaceBuffer((body, _, res) => {
if (!res)
return body;
- const htmlContentWithIframeResizerScript = this.injectIframeResizerScript(body);
- const htmlContentWithBridgeScript = this.injectGlobalBridgeScript(htmlContentWithIframeResizerScript);
- const cspDetails = new csp_1.CSPProcessingService({ info: () => { } }).getCspDetails(htmlContentWithBridgeScript, ResourceTunnelServer.transformPermissionsWithRemotes(permissions, remotes));
+ let htmlContent = body;
+ if (res.get('url') === '/') {
+ const htmlContentWithIframeResizerScript = this.injectIframeResizerScript(body);
+ const htmlContentWithBridgeScript = this.injectGlobalBridgeScript(htmlContentWithIframeResizerScript);
+ htmlContent = htmlContentWithBridgeScript;
+ }
+ const cspDetails = new csp_1.CSPProcessingService({ info: () => { } }).getCspDetails(htmlContent, ResourceTunnelServer.transformPermissionsWithRemotes(permissions, remotes));
res.setHeader('Content-Security-Policy', this.getCspHeader(cspDetails));
- return htmlContentWithBridgeScript;
+ return htmlContent;
});
getI18nResourcesMiddleware = (i18nConfig) => {
const i18nResourcesPathRegex = /^\/__LOCALES__\/(.+)\.json$/i;
const i18nResourceFileAccessor = new cli_shared_1.I18nResourceBundlingService().createFileAccessor(i18nConfig);