File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -110,17 +110,16 @@ export async function startApiServer(opts: {
110
110
// Get the url pathname without a query string or fragment
111
111
// (note base url doesn't matter, but required by URL constructor)
112
112
try {
113
- let pathTemplate = new URL ( path , 'http://x' ) . pathname ;
113
+ const pathTemplate = new URL ( path , 'http://x' ) . pathname ;
114
114
// Match request url to the Express route, e.g.:
115
115
// `/extended/v1/address/ST26DR4VGV507V1RZ1JNM7NN4K3DTGX810S62SBBR/stx` to
116
116
// `/extended/v1/address/:stx_address/stx`
117
117
for ( const pathRegex of routes ) {
118
118
if ( pathRegex . regexp . test ( pathTemplate ) ) {
119
- pathTemplate = pathRegex . path ;
120
- break ;
119
+ return pathRegex . path ;
121
120
}
122
121
}
123
- return pathTemplate ;
122
+ return '<invalid_path>' ;
124
123
} catch ( error ) {
125
124
logger . warn ( `Warning: ${ error } ` ) ;
126
125
return path ;
You can’t perform that action at this time.
0 commit comments