From 8d1bbaf213cd21f99d69e9fc2f8a7f7d11019d60 Mon Sep 17 00:00:00 2001 From: hasundue Date: Wed, 6 Mar 2024 17:51:21 +0900 Subject: [PATCH] test(lib): remove a trailing slash from redirect --- lib/testing.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/testing.ts b/lib/testing.ts index 9b708640..851a5208 100644 --- a/lib/testing.ts +++ b/lib/testing.ts @@ -154,7 +154,9 @@ function parseDenoLandUrl(url: URL) { return { name: std ? "deno.land/std" : `deno.land/x/${name}`, version, - path, + // Remove a trailing slash if it exists to imitate the behavior of typical + // Web servers. + path: path.replace(/\/$/, ""), }; }