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,26 +1,18 @@
|
||||
require('@alfresco/adf-cli/tooling').dotenvConfig({ path: process.env.ENV_FILE });
|
||||
|
||||
const { BASE_URL } = process.env;
|
||||
console.log('Using backend URL: ' + (BASE_URL || 'unknown'));
|
||||
|
||||
module.exports = {
|
||||
"/alfresco": {
|
||||
"target": BASE_URL,
|
||||
"secure": false,
|
||||
"pathRewrite": {
|
||||
"^/alfresco/alfresco": ""
|
||||
},
|
||||
"changeOrigin": true,
|
||||
'logLevel': 'debug',
|
||||
onProxyReq: function(request) {
|
||||
if(request["method"] !== "GET")
|
||||
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;
|
||||
}
|
||||
'/alfresco': {
|
||||
target: BASE_URL,
|
||||
secure: false,
|
||||
pathRewrite: {
|
||||
'^/alfresco/alfresco': ''
|
||||
},
|
||||
changeOrigin: true,
|
||||
onProxyReq: (request) => {
|
||||
if (request['method'] !== 'GET') {
|
||||
request.setHeader('origin', BASE_URL);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user