File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -257,7 +257,7 @@ class API {
257
257
// Strip the headers, keep whitelist
258
258
const strippedHeaders = Object . entries ( response . _headers ) . reduce ( ( acc , [ headerName , value ] ) => {
259
259
if ( ! this . _errorHeaderWhitelist . includes ( headerName . toLowerCase ( ) ) ) return acc
260
-
260
+
261
261
return {
262
262
...acc ,
263
263
[ headerName ] : value
@@ -476,8 +476,10 @@ class API {
476
476
// Execute the routing function
477
477
fn ( this , options )
478
478
479
- // Remove the last prefix
480
- if ( prefix . length ) this . _prefix = this . _prefix . slice ( 0 , - ( prefix . length ) )
479
+ // Remove the last prefix (if a prefix exists)
480
+ if ( prefix . length > 0 ) {
481
+ this . _prefix = this . _prefix . slice ( 0 , - ( prefix . length ) )
482
+ }
481
483
482
484
} // end register
483
485
You can’t perform that action at this time.
0 commit comments