diff --git a/.angular-cli.json b/.angular-cli.json index 4b2170bbe..8fbc0f913 100644 --- a/.angular-cli.json +++ b/.angular-cli.json @@ -77,7 +77,7 @@ "styleExt": "scss", "component": {}, "serve": { - "proxyConfig": "proxy.conf.json", + "proxyConfig": "proxy.conf.js", "port": 3000 } } diff --git a/proxy.conf.js b/proxy.conf.js new file mode 100644 index 000000000..5bea784f0 --- /dev/null +++ b/proxy.conf.js @@ -0,0 +1,14 @@ +module.exports = { + "/alfresco": { + "target": "http://0.0.0.0:8080", + "secure": false, + "changeOrigin": true, + // workaround for REPO-2260 + onProxyRes: function (proxyRes, req, res) { + const header = proxyRes.headers['www-authenticate']; + if (header && header.startsWith('Basic')) { + proxyRes.headers['www-authenticate'] = 'x' + header; + } + } + } +}; diff --git a/proxy.conf.json b/proxy.conf.json deleted file mode 100644 index 8846e34c2..000000000 --- a/proxy.conf.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "/alfresco": { - "target": "http://0.0.0.0:8080", - "secure": false, - "changeOrigin": true - } -}