File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -160,7 +160,7 @@ if (isRelativeUrl(apiUrl)) {
160160 }
161161} else if ( apiUrl ) {
162162 beforeFilesRewrites . push ( {
163- source : '/api/:path((?!auth(?:/|$)| config(?:/|$)).*)' ,
163+ source : '/api/:path((?!config(?:/|$)).*)' ,
164164 destination : `${ apiUrl . replace ( / \/ + $ / , '' ) } /:path` ,
165165 } ) ;
166166}
Original file line number Diff line number Diff line change @@ -20,13 +20,22 @@ describe('getApiUrl', () => {
2020 ) . toBe ( '/analytics/internal-api/websites' ) ;
2121 } ) ;
2222
23- test ( 'keeps app routes on the local api path ' , ( ) => {
23+ test ( 'uses a relative API_URL for auth routes ' , ( ) => {
2424 expect (
2525 getApiUrl ( '/auth/verify' , {
2626 apiUrl : '/internal-api' ,
2727 basePath : '/analytics' ,
2828 } ) ,
29- ) . toBe ( '/analytics/api/auth/verify' ) ;
29+ ) . toBe ( '/analytics/internal-api/auth/verify' ) ;
30+ } ) ;
31+
32+ test ( 'keeps config routes on the local api path' , ( ) => {
33+ expect (
34+ getApiUrl ( '/config' , {
35+ apiUrl : '/internal-api' ,
36+ basePath : '/analytics' ,
37+ } ) ,
38+ ) . toBe ( '/analytics/api/config' ) ;
3039 } ) ;
3140
3241 test ( 'returns absolute input urls unchanged' , ( ) => {
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ type ApiUrlOptions = {
33 basePath ?: string ;
44} ;
55
6- const APP_ROUTE_PATTERNS : RegExp [ ] = [ / ^ \/ a u t h ( \/ | $ ) / , / ^ \/ c o n f i g ( \/ | $ ) / ] ;
6+ const APP_ROUTE_PATTERNS : RegExp [ ] = [ / ^ \/ c o n f i g ( \/ | $ ) / ] ;
77
88function trimTrailingSlash ( value : string ) {
99 return value . replace ( / \/ + $ / , '' ) ;
You can’t perform that action at this time.
0 commit comments