Skip to content

Commit e06193a

Browse files
authored
Update all dependencies (#450)
* Update all dependencies * Fix tests for changes in router param matching
1 parent 75a8408 commit e06193a

File tree

8 files changed

+640
-517
lines changed

8 files changed

+640
-517
lines changed

Cargo.lock

+625-501
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

worker-macros/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ worker-sys = { path = "../worker-sys", version = "0.0.10" }
1717
syn = "2.0.17"
1818
proc-macro2 = "1.0.60"
1919
quote = "1.0.28"
20-
wasm-bindgen = "=0.2.87"
20+
wasm-bindgen = "0.2"
2121
wasm-bindgen-futures = "0.4.36"
2222
wasm-bindgen-macro-support = "0.2.87"
2323

worker-sandbox/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ cfg-if = "1.0.0"
2222
console_error_panic_hook = { version = "0.1.7", optional = true }
2323
getrandom = { version = "0.2.10", features = ["js"] }
2424
hex = "0.4.3"
25-
http = "0.2.9"
25+
http = "1"
2626
regex = "1.8.4"
2727
serde = { version = "1.0.164", features = ["derive"] }
2828
serde_json = "1.0.96"
@@ -46,6 +46,6 @@ reqwest = { version = "0.11.18", features = [
4646
"stream",
4747
] }
4848
tokio = { version = "1.28.2", features = ["macros", "rt", "test-util"] }
49-
tungstenite = "0.17.3"
49+
tungstenite = "0.21"
5050
wasm-bindgen-test = "0.3.36"
5151
retry = "2.0.0"

worker-sandbox/src/lib.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -356,8 +356,7 @@ pub async fn main(req: Request, env: Env, _ctx: worker::Context) -> Result<Respo
356356
))
357357
})
358358
.get_async("/proxy_request/*url", |_req, ctx| async move {
359-
let url = ctx.param("url").unwrap().strip_prefix('/').unwrap();
360-
359+
let url = ctx.param("url").unwrap();
361360
Fetch::Url(url.parse()?).send().await
362361
})
363362
.get_async("/durable/alarm", |_req, ctx| async move {

worker-sandbox/tests/request.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ test("catchall", async () => {
189189
method: "OPTIONS",
190190
});
191191

192-
expect(await resp.text()).toBe("/hello-world");
192+
expect(await resp.text()).toBe("hello-world");
193193
});
194194

195195
test("redirect default", async () => {

worker-sys/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ description = "Low-level extern definitions / FFI bindings to the Cloudflare Wor
1010
[dependencies]
1111
cfg-if = "1.0.0"
1212
js-sys = "0.3.63"
13-
wasm-bindgen = "=0.2.87"
13+
wasm-bindgen = "0.2"
1414

1515
[dependencies.web-sys]
1616
version = "0.3.63"

worker/Cargo.toml

+4-4
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@ chrono = { version = "0.4.26", default-features = false, features = [
1919
chrono-tz = { version = "0.8.2", default-features = false }
2020
futures-channel = "0.3.28"
2121
futures-util = { version = "0.3.28", default-features = false }
22-
http = "0.2.9"
22+
http = "1"
2323
js-sys = "0.3.63"
24-
matchit = "0.4.6"
24+
matchit = "0.7"
2525
pin-project = "1.1.0"
2626
serde = { version = "1.0.164", features = ["derive"] }
2727
serde_json = "1.0.96"
2828
tokio = { version = "1.28", default-features = false }
2929
url = "2.4.0"
30-
wasm-bindgen = "=0.2.87"
30+
wasm-bindgen = "0.2"
3131
wasm-bindgen-futures = "0.4.36"
3232
serde-wasm-bindgen = "0.6.1"
3333
serde_urlencoded = "0.7"
34-
wasm-streams = "0.3.0"
34+
wasm-streams = "0.4"
3535
worker-kv = "0.6.0"
3636
worker-macros = { path = "../worker-macros", version = "0.0.10" }
3737
worker-sys = { path = "../worker-sys", version = "0.0.10" }

worker/src/router.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::{collections::HashMap, future::Future, rc::Rc};
22

33
use futures_util::future::LocalBoxFuture;
4-
use matchit::{Match, Node};
4+
use matchit::{Match, Router as MatchItRouter};
55
use worker_kv::KvStore;
66

77
use crate::{
@@ -43,8 +43,8 @@ impl<D> Clone for Handler<'_, D> {
4343

4444
/// A path-based HTTP router supporting exact-match or wildcard placeholders and shared data.
4545
pub struct Router<'a, D> {
46-
handlers: HashMap<Method, Node<Handler<'a, D>>>,
47-
or_else_any_method: Node<Handler<'a, D>>,
46+
handlers: HashMap<Method, MatchItRouter<Handler<'a, D>>>,
47+
or_else_any_method: MatchItRouter<Handler<'a, D>>,
4848
data: D,
4949
}
5050

@@ -126,7 +126,7 @@ impl<'a, D: 'a> Router<'a, D> {
126126
pub fn with_data(data: D) -> Self {
127127
Self {
128128
handlers: HashMap::new(),
129-
or_else_any_method: Node::new(),
129+
or_else_any_method: MatchItRouter::new(),
130130
data,
131131
}
132132
}
@@ -383,7 +383,7 @@ impl<'a, D: 'a> Router<'a, D> {
383383
}
384384
}
385385

386-
type NodeWithHandlers<'a, D> = Node<Handler<'a, D>>;
386+
type NodeWithHandlers<'a, D> = MatchItRouter<Handler<'a, D>>;
387387

388388
impl<'a, D: 'a> Router<'a, D> {
389389
fn split(

0 commit comments

Comments
 (0)