File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -1222,4 +1222,39 @@ test.group('Server | all', (group) => {
1222
1222
const { body } = await supertest ( httpServer ) . get ( '/users/1' ) . expect ( 200 )
1223
1223
assert . deepEqual ( body , { matchesRoute : true } )
1224
1224
} )
1225
+
1226
+ /**
1227
+ * Reproducing regression
1228
+ */
1229
+ test ( 'find if the signed url signature is valid' , async ( assert ) => {
1230
+ const app = await setupApp ( )
1231
+ const server = new Server (
1232
+ app ,
1233
+ encryption ,
1234
+ Object . assign ( { } , serverConfig , {
1235
+ forceContentNegotiationToJSON : true ,
1236
+ } )
1237
+ )
1238
+
1239
+ const httpServer = createServer ( server . handle . bind ( server ) )
1240
+ server . router
1241
+ . get ( '/users/:id' , async ( { request } ) => {
1242
+ return {
1243
+ hasValidSignature : request . hasValidSignature ( ) ,
1244
+ }
1245
+ } )
1246
+ . as ( 'showUser' )
1247
+
1248
+ server . optimize ( )
1249
+
1250
+ /**
1251
+ * Make a signed url
1252
+ */
1253
+ const url = server . router . makeSignedUrl ( 'showUser' , [ 1 ] , {
1254
+ qs : { site : 1 , db : 'pg' , dbUser : 1 } ,
1255
+ } )
1256
+
1257
+ const { body } = await supertest ( httpServer ) . get ( url ) . expect ( 200 )
1258
+ assert . deepEqual ( body , { hasValidSignature : true } )
1259
+ } )
1225
1260
} )
You can’t perform that action at this time.
0 commit comments