Skip to content

Commit

Permalink
Fix tests for changes in router param matching
Browse files Browse the repository at this point in the history
  • Loading branch information
kflansburg committed Feb 26, 2024
1 parent 8ef896b commit 139ee7f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions worker-sandbox/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,7 @@ pub async fn main(req: Request, env: Env, _ctx: worker::Context) -> Result<Respo
))
})
.get_async("/proxy_request/*url", |_req, ctx| async move {
let url = ctx.param("url").unwrap().strip_prefix('/').unwrap();

let url = ctx.param("url").unwrap();
Fetch::Url(url.parse()?).send().await
})
.get_async("/durable/alarm", |_req, ctx| async move {
Expand Down
2 changes: 1 addition & 1 deletion worker-sandbox/tests/request.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ test("catchall", async () => {
method: "OPTIONS",
});

expect(await resp.text()).toBe("/hello-world");
expect(await resp.text()).toBe("hello-world");
});

test("redirect default", async () => {
Expand Down

0 comments on commit 139ee7f

Please sign in to comment.