Deduce secondary host from the request if possible

上级 aef539ad
......@@ -377,13 +377,18 @@ async function handleRoot(req, res) {
fancyLog(`${ansiColors.magenta('Additional extensions')}: ${staticExtensions.map(e => path.basename(e.extensionLocation.path)).join(', ') || 'None'}`);
}
const secondaryHost = (
req.headers['host']
? req.headers['host'].replace(':' + PORT, ':' + SECONDARY_PORT)
: `${HOST}:${SECONDARY_PORT}`
);
const webConfigJSON = {
folderUri: folderUri,
staticExtensions,
settingsSyncOptions: {
enabled: args['enable-sync']
},
webWorkerExtensionHostIframeSrc: `${SCHEME}://${HOST}:${SECONDARY_PORT}/static/out/vs/workbench/services/extensions/worker/httpWebWorkerExtensionHostIframe.html`
webWorkerExtensionHostIframeSrc: `${SCHEME}://${secondaryHost}/static/out/vs/workbench/services/extensions/worker/httpWebWorkerExtensionHostIframe.html`
};
if (args['wrap-iframe']) {
webConfigJSON._wrapWebWorkerExtHostInIframe = true;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册