File tree 1 file changed +6
-4
lines changed
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -45,9 +45,11 @@ describe("update", () => {
45
45
return response . end ( )
46
46
}
47
47
48
- // NOTES subpath match /redirect/${number}
49
- // if number === 0, resolve it
50
- if ( request . url . match ( / \/ r e d i r e c t \/ [ 0 - 9 ] / ) ) {
48
+ // Checks if url matches /redirect/${number}
49
+ // with optional trailing slash
50
+ let redirectSlashNumberRegExp = new RegExp ( / \/ r e d i r e c t \/ ( [ 0 - 9 ] + ) ( \/ ) ? $ / )
51
+
52
+ if ( request . url . match ( redirectSlashNumberRegExp ) ) {
51
53
if ( request . url === "/redirect/0" ) {
52
54
response . writeHead ( 200 )
53
55
return response . end ( "done" )
@@ -259,7 +261,7 @@ describe("update", () => {
259
261
260
262
it ( "should reject if more than 10 redirects" , async ( ) => {
261
263
if ( isAddressInfo ( _address ) ) {
262
- const mockURL = `http://${ _address . address } :${ _address . port } /redirect/10 `
264
+ const mockURL = `http://${ _address . address } :${ _address . port } /redirect/11 `
263
265
let provider = new UpdateProvider ( mockURL , settings ( ) )
264
266
let update = await provider . getUpdate ( true )
265
267
You can’t perform that action at this time.
0 commit comments