mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-09-10 14:11:17 +00:00
Proxy: remove dependency on ADF cli, cleanup (#4760)
This commit is contained in:
@@ -1,25 +1,17 @@
|
|||||||
require('@alfresco/adf-cli/tooling').dotenvConfig({ path: process.env.ENV_FILE });
|
|
||||||
|
|
||||||
const { BASE_URL } = process.env;
|
const { BASE_URL } = process.env;
|
||||||
|
console.log('Using backend URL: ' + (BASE_URL || 'unknown'));
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
"/alfresco": {
|
'/alfresco': {
|
||||||
"target": BASE_URL,
|
target: BASE_URL,
|
||||||
"secure": false,
|
secure: false,
|
||||||
"pathRewrite": {
|
pathRewrite: {
|
||||||
"^/alfresco/alfresco": ""
|
'^/alfresco/alfresco': ''
|
||||||
},
|
},
|
||||||
"changeOrigin": true,
|
changeOrigin: true,
|
||||||
'logLevel': 'debug',
|
onProxyReq: (request) => {
|
||||||
onProxyReq: function(request) {
|
if (request['method'] !== 'GET') {
|
||||||
if(request["method"] !== "GET")
|
request.setHeader('origin', BASE_URL);
|
||||||
request.setHeader("origin", BASE_URL);
|
|
||||||
},
|
|
||||||
// workaround for REPO-2260
|
|
||||||
onProxyRes: function (proxyRes) {
|
|
||||||
const header = proxyRes.headers['www-authenticate'];
|
|
||||||
if (header?.startsWith('Basic')) {
|
|
||||||
proxyRes.headers['www-authenticate'] = 'x' + header;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user