File tree Expand file tree Collapse file tree 1 file changed +12
-20
lines changed Expand file tree Collapse file tree 1 file changed +12
-20
lines changed Original file line number Diff line number Diff line change 1- require ( '@alfresco/adf-cli/tooling' ) . dotenvConfig ( { path : process . env . ENV_FILE } ) ;
2-
31const { BASE_URL } = process . env ;
2+ console . log ( 'Using backend URL: ' + ( BASE_URL || 'unknown' ) ) ;
43
54module . exports = {
6- "/alfresco" : {
7- "target" : BASE_URL ,
8- "secure" : false ,
9- "pathRewrite" : {
10- "^/alfresco/alfresco" : ""
11- } ,
12- "changeOrigin" : true ,
13- 'logLevel' : 'debug' ,
14- onProxyReq : function ( request ) {
15- if ( request [ "method" ] !== "GET" )
16- request . setHeader ( "origin" , BASE_URL ) ;
17- } ,
18- // workaround for REPO-2260
19- onProxyRes : function ( proxyRes ) {
20- const header = proxyRes . headers [ 'www-authenticate' ] ;
21- if ( header ?. startsWith ( 'Basic' ) ) {
22- proxyRes . headers [ 'www-authenticate' ] = 'x' + header ;
23- }
5+ '/alfresco' : {
6+ target : BASE_URL ,
7+ secure : false ,
8+ pathRewrite : {
9+ '^/alfresco/alfresco' : ''
10+ } ,
11+ changeOrigin : true ,
12+ onProxyReq : ( request ) => {
13+ if ( request [ 'method' ] !== 'GET' ) {
14+ request . setHeader ( 'origin' , BASE_URL ) ;
2415 }
2516 }
17+ }
2618} ;
You can’t perform that action at this time.
0 commit comments