File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
packages/cache-handlers/test/deno Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -45,9 +45,10 @@ Deno.test("Security - Extremely long cache keys", () => {
4545
4646 // Should not throw and should handle gracefully
4747 const cacheKey = defaultGetCacheKey ( request ) ;
48+ const parsedUrl = new URL ( cacheKey ) ;
4849 assert (
49- cacheKey . startsWith ( "https:// example.com") ,
50- "Cache key should start with origin " ,
50+ parsedUrl . host === " example.com",
51+ "Cache key should have host 'example.com' " ,
5152 ) ;
5253 assert ( cacheKey . length > 100000 , "Cache key should be long" ) ;
5354} ) ;
@@ -75,9 +76,10 @@ Deno.test("Security - Vary header bomb attack", () => {
7576
7677 // Should complete in reasonable time (less than 100ms)
7778 assert ( duration < 100 , `Cache key generation took too long: ${ duration } ms` ) ;
79+ const parsedUrl = new URL ( cacheKey ) ;
7880 assert (
79- cacheKey . startsWith ( "https:// example.com") ,
80- "Cache key should start with origin " ,
81+ parsedUrl . host === " example.com",
82+ "Cache key should have host 'example.com' " ,
8183 ) ;
8284} ) ;
8385
You can’t perform that action at this time.
0 commit comments