From bdfb5b8e963662802e40ad82e3602c585bd4d3b1 Mon Sep 17 00:00:00 2001 From: Daniel Santana Date: Mon, 27 Nov 2023 18:52:02 +0000 Subject: [PATCH 01/21] chore(deps): bump http to 1.0 on gloo-net --- Cargo.lock | 440 ++++++++++++++++++++---------------------- Cargo.toml | 2 +- crates/net/Cargo.toml | 4 +- 3 files changed, 216 insertions(+), 230 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0b1a2c60..cde475e1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "addr2line" -version = "0.20.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4fa78e18c64fce05e902adecd7a5eed15a5e0a3439f7b0e169f0252214865e3" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" dependencies = [ "gimli", ] @@ -46,9 +46,9 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "backtrace" -version = "0.3.68" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4319208da049c43661739c5fade2ba182f09d1dc2299b32298d3a31692b17e12" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" dependencies = [ "addr2line", "cc", @@ -61,21 +61,15 @@ dependencies = [ [[package]] name = "base64" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" - -[[package]] -name = "base64" -version = "0.21.2" +version = "0.21.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" +checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" [[package]] name = "basic-toml" -version = "0.1.4" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bfc506e7a2370ec239e1d072507b2a80c833083699d3c6fa176fbb4de8448c6" +checksum = "2f2139706359229bfa8f19142ac1155b4b80beafb7a60471ac5dd109d4a19778" dependencies = [ "serde", ] @@ -112,27 +106,27 @@ checksum = "cfa8873f51c92e232f9bac4065cddef41b714152812bfc5f7672ba16d6ef8cd9" [[package]] name = "bumpalo" -version = "3.13.0" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" [[package]] name = "byteorder" -version = "1.4.3" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" [[package]] name = "cc" -version = "1.0.82" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "305fe645edc1442a0fa8b6726ba61d422798d37a52e12eaecf4b022ebbb88f01" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" dependencies = [ "libc", ] @@ -145,17 +139,16 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.26" +version = "0.4.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec837a71355b28f6556dbd569b37b3f363091c0bd4b2e735674521b4c5fd9bc5" +checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" dependencies = [ "android-tzdata", "iana-time-zone", "js-sys", "num-traits", - "time", "wasm-bindgen", - "winapi", + "windows-targets", ] [[package]] @@ -176,9 +169,9 @@ checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" [[package]] name = "cpufeatures" -version = "0.2.9" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" +checksum = "ce420fe07aecd3e67c5f910618fe65e94158f6dcc0adf44e00d69ce2bdfe0fd0" dependencies = [ "libc", ] @@ -195,9 +188,9 @@ dependencies = [ [[package]] name = "data-encoding" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" +checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" [[package]] name = "digest" @@ -211,9 +204,9 @@ dependencies = [ [[package]] name = "encoding_rs" -version = "0.8.32" +version = "0.8.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394" +checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" dependencies = [ "cfg-if", ] @@ -247,7 +240,7 @@ dependencies = [ "hex", "js-sys", "serde", - "serde-wasm-bindgen 0.6.0", + "serde-wasm-bindgen 0.6.1", "sha2", "wasm-bindgen", "wasm-bindgen-futures", @@ -295,18 +288,18 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "form_urlencoded" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ "percent-encoding", ] [[package]] name = "futures" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" +checksum = "da0290714b38af9b4a7b094b8a37086d1b4e61f2df9122c3cad2577669145335" dependencies = [ "futures-channel", "futures-core", @@ -319,9 +312,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" +checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb" dependencies = [ "futures-core", "futures-sink", @@ -329,15 +322,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" +checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" [[package]] name = "futures-executor" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" +checksum = "0f4fb8693db0cf099eadcca0efe2a5a22e4550f98ed16aba6c48700da29597bc" dependencies = [ "futures-core", "futures-task", @@ -346,38 +339,38 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" +checksum = "8bf34a163b5c4c52d0478a4d757da8fb65cabef42ba90515efee0f6f9fa45aaa" [[package]] name = "futures-macro" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" +checksum = "53b153fd91e4b0147f4aced87be237c98248656bb01050b96bf3ee89220a8ddb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.39", ] [[package]] name = "futures-sink" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" +checksum = "e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817" [[package]] name = "futures-task" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" +checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2" [[package]] name = "futures-util" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" +checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104" dependencies = [ "futures-channel", "futures-core", @@ -403,22 +396,22 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.10" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" dependencies = [ "cfg-if", "js-sys", "libc", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi", "wasm-bindgen", ] [[package]] name = "gimli" -version = "0.27.3" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" [[package]] name = "glob" @@ -453,8 +446,8 @@ dependencies = [ "gloo-dialogs 0.2.0", "gloo-events 0.2.0", "gloo-file 0.3.0", - "gloo-history 0.2.0", - "gloo-net 0.4.0", + "gloo-history 0.2.1", + "gloo-net 0.5.0", "gloo-render 0.2.0", "gloo-storage 0.3.0", "gloo-timers 0.3.0", @@ -573,14 +566,14 @@ dependencies = [ [[package]] name = "gloo-history" -version = "0.2.0" +version = "0.2.1" dependencies = [ "getrandom", "gloo-events 0.2.0", "gloo-timers 0.3.0", "gloo-utils 0.2.0", "serde", - "serde-wasm-bindgen 0.6.0", + "serde-wasm-bindgen 0.6.1", "serde_urlencoded", "thiserror", "wasm-bindgen", @@ -598,7 +591,7 @@ dependencies = [ "futures-core", "futures-sink", "gloo-utils 0.1.7", - "http", + "http 0.2.11", "js-sys", "pin-project", "serde", @@ -611,7 +604,7 @@ dependencies = [ [[package]] name = "gloo-net" -version = "0.4.0" +version = "0.5.0" dependencies = [ "futures", "futures-channel", @@ -619,7 +612,7 @@ dependencies = [ "futures-io", "futures-sink", "gloo-utils 0.2.0", - "http", + "http 1.0.0", "js-sys", "once_cell", "pin-project", @@ -770,23 +763,23 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.39", "trybuild", ] [[package]] name = "h2" -version = "0.3.20" +version = "0.3.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97ec8491ebaf99c8eaa73058b045fe58073cd6be7f596ac993ced0b0a0c01049" +checksum = "4d6250322ef6e60f93f9a2162799302cd6f68f79f6e5d85c8c16f14d1d958178" dependencies = [ "bytes", "fnv", "futures-core", "futures-sink", "futures-util", - "http", - "indexmap 1.9.3", + "http 0.2.11", + "indexmap 2.1.0", "slab", "tokio", "tokio-util", @@ -801,21 +794,20 @@ checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "hashbrown" -version = "0.14.0" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" [[package]] name = "headers" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3e372db8e5c0d213e0cd0b9be18be2aca3d44cf2fe30a9d46a65581cd454584" +checksum = "06683b93020a07e3dbcf5f8c0f6d40080d725bea7936fc01ad345c01b97dc270" dependencies = [ - "base64 0.13.1", - "bitflags", + "base64", "bytes", "headers-core", - "http", + "http 0.2.11", "httpdate", "mime", "sha1", @@ -827,14 +819,14 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e7f66481bfee273957b1f20485a4ff3362987f85b2c236580d81b4eb7a326429" dependencies = [ - "http", + "http 0.2.11", ] [[package]] name = "hermit-abi" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" +checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" [[package]] name = "hex" @@ -844,9 +836,20 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "http" -version = "0.2.9" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" +checksum = "b32afd38673a8016f7c9ae69e5af41a58f81b1d31689040f2f1959594ce194ea" dependencies = [ "bytes", "fnv", @@ -860,7 +863,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" dependencies = [ "bytes", - "http", + "http 0.2.11", "pin-project-lite", ] @@ -887,13 +890,13 @@ dependencies = [ "futures-core", "futures-util", "h2", - "http", + "http 0.2.11", "http-body", "httparse", "httpdate", "itoa", "pin-project-lite", - "socket2 0.4.9", + "socket2 0.4.10", "tokio", "tower-service", "tracing", @@ -902,16 +905,16 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.57" +version = "0.1.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fad5b825842d2b38bd206f3e81d6957625fd7f0a361e345c30e01a0ae2dd613" +checksum = "8326b86b6cff230b97d0d312a6c40a60726df3332e721f72a1b035f451663b20" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "windows", + "windows-core", ] [[package]] @@ -925,9 +928,9 @@ dependencies = [ [[package]] name = "idna" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -954,12 +957,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.0.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" +checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" dependencies = [ "equivalent", - "hashbrown 0.14.0", + "hashbrown 0.14.3", ] [[package]] @@ -970,24 +973,24 @@ checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "js-sys" -version = "0.3.64" +version = "0.3.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +checksum = "cee9c64da59eae3b50095c18d3e74f8b73c0b86d2792824ff01bbce68ba229ca" dependencies = [ "wasm-bindgen", ] [[package]] name = "libc" -version = "0.2.147" +version = "0.2.150" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" +checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" [[package]] name = "lock_api" -version = "0.4.10" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" +checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" dependencies = [ "autocfg", "scopeguard", @@ -1001,9 +1004,9 @@ checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "memchr" -version = "2.5.0" +version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" [[package]] name = "mime" @@ -1032,12 +1035,12 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.8" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" +checksum = "3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0" dependencies = [ "libc", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi", "windows-sys", ] @@ -1050,7 +1053,7 @@ dependencies = [ "bytes", "encoding_rs", "futures-util", - "http", + "http 0.2.11", "httparse", "log", "memchr", @@ -1061,9 +1064,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" dependencies = [ "autocfg", ] @@ -1080,9 +1083,9 @@ dependencies = [ [[package]] name = "object" -version = "0.31.1" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bda667d9f2b5051b8833f59f3bf748b28ef54f850f4fcb389a252aa383866d1" +checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" dependencies = [ "memchr", ] @@ -1105,9 +1108,9 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.8" +version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" +checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" dependencies = [ "cfg-if", "libc", @@ -1118,9 +1121,9 @@ dependencies = [ [[package]] name = "percent-encoding" -version = "2.3.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pin-project" @@ -1139,14 +1142,14 @@ checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.39", ] [[package]] name = "pin-project-lite" -version = "0.2.12" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12cc1b0bf1727a77a54b6654e7b5f1af8604923edc8b81885f8ec92f9e3f0a05" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" [[package]] name = "pin-utils" @@ -1223,9 +1226,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.66" +version = "1.0.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" +checksum = "39278fbbf5fb4f646ce651690877f89d1c5811a3d4acb27700c1cb3cdb78fd3b" dependencies = [ "unicode-ident", ] @@ -1299,9 +1302,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.3.5" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" dependencies = [ "bitflags", ] @@ -1314,11 +1317,11 @@ checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" [[package]] name = "rustls-pemfile" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" dependencies = [ - "base64 0.21.2", + "base64", ] [[package]] @@ -1347,9 +1350,9 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "serde" -version = "1.0.183" +version = "1.0.193" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32ac8da02677876d532745a130fc9d8e6edfa81a269b107c5b00829b91d8eb3c" +checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" dependencies = [ "serde_derive", ] @@ -1367,9 +1370,9 @@ dependencies = [ [[package]] name = "serde-wasm-bindgen" -version = "0.6.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30c9933e5689bd420dc6c87b7a1835701810cbc10cd86a26e4da45b73e6b1d78" +checksum = "17ba92964781421b6cef36bf0d7da26d201e96d84e1b10e7ae6ed416e516906d" dependencies = [ "js-sys", "serde", @@ -1378,20 +1381,20 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.183" +version = "1.0.193" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aafe972d60b0b9bee71a91b92fee2d4fb3c9d7e8f6b179aa99f27203d99a4816" +checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.39", ] [[package]] name = "serde_json" -version = "1.0.107" +version = "1.0.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" +checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" dependencies = [ "itoa", "ryu", @@ -1412,9 +1415,9 @@ dependencies = [ [[package]] name = "sha1" -version = "0.10.5" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" dependencies = [ "cfg-if", "cpufeatures", @@ -1443,24 +1446,24 @@ dependencies = [ [[package]] name = "slab" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" dependencies = [ "autocfg", ] [[package]] name = "smallvec" -version = "1.11.0" +version = "1.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" [[package]] name = "socket2" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" dependencies = [ "libc", "winapi", @@ -1468,9 +1471,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.3" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2538b18701741680e0322a2302176d3253a35388e2e62f172f64f4f16605f877" +checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" dependencies = [ "libc", "windows-sys", @@ -1495,9 +1498,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.29" +version = "2.0.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c324c494eba9d92503e6f1ef2e6df781e78f6a7705a0202d9801b198807d518a" +checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" dependencies = [ "proc-macro2", "quote", @@ -1506,42 +1509,31 @@ dependencies = [ [[package]] name = "termcolor" -version = "1.2.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" +checksum = "ff1bc3d3f05aff0403e8ac0d92ced918ec05b666a43f83297ccef5bea8a3d449" dependencies = [ "winapi-util", ] [[package]] name = "thiserror" -version = "1.0.47" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97a802ec30afc17eee47b2855fc72e0c4cd62be9b4efe6591edde0ec5bd68d8f" +checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.47" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bb623b56e39ab7dcd4b1b98bb6c8f8d907ed255b18de254088016b27a8ee19b" +checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", -] - -[[package]] -name = "time" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" -dependencies = [ - "libc", - "wasi 0.10.0+wasi-snapshot-preview1", - "winapi", + "syn 2.0.39", ] [[package]] @@ -1561,9 +1553,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.32.0" +version = "1.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17ed6077ed6cd6c74735e21f37eb16dc3935f96878b1fe961074089cc80893f9" +checksum = "d0c014766411e834f7af5b8f4cf46257aab4036ca95e9d2c144a10f59ad6f5b9" dependencies = [ "backtrace", "bytes", @@ -1573,20 +1565,20 @@ dependencies = [ "parking_lot", "pin-project-lite", "signal-hook-registry", - "socket2 0.5.3", + "socket2 0.5.5", "tokio-macros", "windows-sys", ] [[package]] name = "tokio-macros" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" +checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.39", ] [[package]] @@ -1614,9 +1606,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.8" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" +checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" dependencies = [ "bytes", "futures-core", @@ -1628,17 +1620,17 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.3" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" [[package]] name = "toml_edit" -version = "0.19.14" +version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8123f27e969974a3dfba720fdb560be359f57b44302d280ba72e76a74480e8a" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.0.0", + "indexmap 2.1.0", "toml_datetime", "winnow", ] @@ -1651,11 +1643,10 @@ checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" -version = "0.1.37" +version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ - "cfg-if", "log", "pin-project-lite", "tracing-attributes", @@ -1664,20 +1655,20 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.26" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.39", ] [[package]] name = "tracing-core" -version = "0.1.31" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", ] @@ -1712,7 +1703,7 @@ dependencies = [ "byteorder", "bytes", "data-encoding", - "http", + "http 0.2.11", "httparse", "log", "rand", @@ -1724,15 +1715,15 @@ dependencies = [ [[package]] name = "typenum" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "unicase" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" +checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" dependencies = [ "version_check", ] @@ -1745,9 +1736,9 @@ checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" @@ -1760,9 +1751,9 @@ dependencies = [ [[package]] name = "url" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" dependencies = [ "form_urlencoded", "idna", @@ -1800,7 +1791,7 @@ dependencies = [ "futures-channel", "futures-util", "headers", - "http", + "http 0.2.11", "hyper", "log", "mime", @@ -1821,12 +1812,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "wasi" -version = "0.10.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" - [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -1835,9 +1820,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.87" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +checksum = "0ed0d4f68a3015cc185aff4db9506a015f4b96f95303897bfa23f846db54064e" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -1845,24 +1830,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.87" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +checksum = "1b56f625e64f3a1084ded111c4d5f477df9f8c92df113852fa5a374dbda78826" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.39", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.37" +version = "0.4.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" +checksum = "ac36a15a220124ac510204aec1c3e5db8a22ab06fd6706d881dc6149f8ed9a12" dependencies = [ "cfg-if", "js-sys", @@ -1872,9 +1857,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.87" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +checksum = "0162dbf37223cd2afce98f3d0785506dcb8d266223983e4b5b525859e6e182b2" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1882,28 +1867,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.87" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.39", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.87" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" +checksum = "7ab9b36309365056cd639da3134bf87fa8f3d86008abf99e612384a6eecd459f" [[package]] name = "wasm-bindgen-test" -version = "0.3.37" +version = "0.3.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e6e302a7ea94f83a6d09e78e7dc7d9ca7b186bc2829c24a22d0753efd680671" +checksum = "2cf9242c0d27999b831eae4767b2a146feb0b27d332d553e605864acd2afd403" dependencies = [ "console_error_panic_hook", "js-sys", @@ -1915,12 +1900,13 @@ dependencies = [ [[package]] name = "wasm-bindgen-test-macro" -version = "0.3.37" +version = "0.3.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecb993dd8c836930ed130e020e77d9b2e65dd0fbab1b67c790b0f5d80b11a575" +checksum = "794645f5408c9a039fd09f4d113cdfb2e7eba5ff1956b07bcf701cf4b394fe89" dependencies = [ "proc-macro2", "quote", + "syn 2.0.39", ] [[package]] @@ -1938,9 +1924,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.64" +version = "0.3.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" +checksum = "5db499c5f66323272151db0e666cd34f78617522fb0c1604d31a27c50c206a85" dependencies = [ "js-sys", "wasm-bindgen", @@ -1964,9 +1950,9 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" dependencies = [ "winapi", ] @@ -1978,10 +1964,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] -name = "windows" -version = "0.48.0" +name = "windows-core" +version = "0.51.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" +checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" dependencies = [ "windows-targets", ] @@ -2054,9 +2040,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "winnow" -version = "0.5.14" +version = "0.5.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d09770118a7eb1ccaf4a594a221334119a44a814fcb0d31c5b85e83e97227a97" +checksum = "829846f3e3db426d4cee4510841b71a8e58aa2a76b1132579487ae430ccd9c7b" dependencies = [ "memchr", ] diff --git a/Cargo.toml b/Cargo.toml index c002e966..3737ef68 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,7 +23,7 @@ gloo-console = { version = "0.3", path = "crates/console", optional = true } gloo-utils = { version = "0.2", path = "crates/utils", optional = true } gloo-history = { version = "0.2", path = "crates/history", optional = true } gloo-worker = { version = "0.4", path = "crates/worker", optional = true } -gloo-net = { version = "0.4", path = "crates/net", optional = true } +gloo-net = { version = "0.5", path = "crates/net", optional = true } [features] default = [ diff --git a/crates/net/Cargo.toml b/crates/net/Cargo.toml index 5c9ae3ec..73681ee5 100644 --- a/crates/net/Cargo.toml +++ b/crates/net/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "gloo-net" -version = "0.4.0" +version = "0.5.0" authors = [ "Rust and WebAssembly Working Group", "Muhammad Hamza ", @@ -36,7 +36,7 @@ serde_json = { version = "1.0", optional = true } futures-channel = { version = "0.3", optional = true } pin-project = { version = "1.0", optional = true } -http = "0.2.9" +http = "1.0" [dev-dependencies] wasm-bindgen-test = "0.3" From 1fa770e82dd7f598be831b2bd25e7b3e213ff26a Mon Sep 17 00:00:00 2001 From: Daniel Santana Date: Wed, 29 Nov 2023 07:50:40 +0000 Subject: [PATCH 02/21] chore(config): update to rust version 1.67 --- crates/net/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/net/Cargo.toml b/crates/net/Cargo.toml index 73681ee5..7c895f94 100644 --- a/crates/net/Cargo.toml +++ b/crates/net/Cargo.toml @@ -12,7 +12,7 @@ description = "HTTP requests library for WASM Apps" readme = "README.md" keywords = ["requests", "http", "wasm", "websockets"] categories = ["wasm", "web-programming::http-client", "api-bindings"] -rust-version = "1.64" +rust-version = "1.67" [package.metadata.docs.rs] all-features = true From 90bb8e6a548bebc779b8b50b83e1dedb065b226a Mon Sep 17 00:00:00 2001 From: Daniel Santana Date: Wed, 29 Nov 2023 07:58:39 +0000 Subject: [PATCH 03/21] chore: git workflow updated to rust 1.67 --- .github/workflows/tests.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 406eec57..3e089364 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -10,7 +10,7 @@ jobs: strategy: fail-fast: false matrix: - rust-version: [1.64, stable, nightly] + rust-version: [1.67, stable, nightly] name: Native Tests runs-on: ubuntu-latest steps: @@ -37,7 +37,7 @@ jobs: strategy: fail-fast: false matrix: - rust-version: [1.64, stable, nightly] + rust-version: [1.67, stable, nightly] name: Browser Tests runs-on: ubuntu-latest steps: @@ -84,7 +84,7 @@ jobs: strategy: fail-fast: false matrix: - rust-version: [1.64, stable, nightly] + rust-version: [1.67, stable, nightly] name: Node Tests runs-on: ubuntu-latest steps: @@ -127,7 +127,7 @@ jobs: matrix: # example: [ markdown, prime ] example: [ markdown ] - rust-version: [1.64, stable, nightly] + rust-version: [1.67, stable, nightly] steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@master @@ -172,7 +172,7 @@ jobs: strategy: fail-fast: false matrix: - rust-version: [1.64, stable, nightly] + rust-version: [1.67, stable, nightly] name: Test gloo-net runs-on: ubuntu-latest services: From c5f28a229ad70d14157effaea5efd95a74c06fcf Mon Sep 17 00:00:00 2001 From: Daniel Santana Date: Thu, 30 Nov 2023 11:38:03 +0000 Subject: [PATCH 04/21] Revert "chore: git workflow updated to rust 1.67" This reverts commit 90bb8e6a548bebc779b8b50b83e1dedb065b226a. --- .github/workflows/tests.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3e089364..406eec57 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -10,7 +10,7 @@ jobs: strategy: fail-fast: false matrix: - rust-version: [1.67, stable, nightly] + rust-version: [1.64, stable, nightly] name: Native Tests runs-on: ubuntu-latest steps: @@ -37,7 +37,7 @@ jobs: strategy: fail-fast: false matrix: - rust-version: [1.67, stable, nightly] + rust-version: [1.64, stable, nightly] name: Browser Tests runs-on: ubuntu-latest steps: @@ -84,7 +84,7 @@ jobs: strategy: fail-fast: false matrix: - rust-version: [1.67, stable, nightly] + rust-version: [1.64, stable, nightly] name: Node Tests runs-on: ubuntu-latest steps: @@ -127,7 +127,7 @@ jobs: matrix: # example: [ markdown, prime ] example: [ markdown ] - rust-version: [1.67, stable, nightly] + rust-version: [1.64, stable, nightly] steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@master @@ -172,7 +172,7 @@ jobs: strategy: fail-fast: false matrix: - rust-version: [1.67, stable, nightly] + rust-version: [1.64, stable, nightly] name: Test gloo-net runs-on: ubuntu-latest services: From b95b1163ecf5f52c55501f40c0ccf074dc343b92 Mon Sep 17 00:00:00 2001 From: Daniel Santana Date: Thu, 30 Nov 2023 11:38:16 +0000 Subject: [PATCH 05/21] Revert "chore(config): update to rust version 1.67" This reverts commit 1fa770e82dd7f598be831b2bd25e7b3e213ff26a. --- crates/net/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/net/Cargo.toml b/crates/net/Cargo.toml index 7c895f94..73681ee5 100644 --- a/crates/net/Cargo.toml +++ b/crates/net/Cargo.toml @@ -12,7 +12,7 @@ description = "HTTP requests library for WASM Apps" readme = "README.md" keywords = ["requests", "http", "wasm", "websockets"] categories = ["wasm", "web-programming::http-client", "api-bindings"] -rust-version = "1.67" +rust-version = "1.64" [package.metadata.docs.rs] all-features = true From bb63166c57fdde8b7831360a9b1d66feb8dfb438 Mon Sep 17 00:00:00 2001 From: Daniel Santana Date: Thu, 30 Nov 2023 11:50:46 +0000 Subject: [PATCH 06/21] feat: Inline http::Method and remove http dependency --- Cargo.lock | 30 +-- crates/net/Cargo.toml | 1 - crates/net/src/http/method.rs | 471 +++++++++++++++++++++++++++++++++ crates/net/src/http/mod.rs | 5 +- crates/net/src/http/request.rs | 3 +- 5 files changed, 484 insertions(+), 26 deletions(-) create mode 100644 crates/net/src/http/method.rs diff --git a/Cargo.lock b/Cargo.lock index cde475e1..cab2e975 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -591,7 +591,7 @@ dependencies = [ "futures-core", "futures-sink", "gloo-utils 0.1.7", - "http 0.2.11", + "http", "js-sys", "pin-project", "serde", @@ -612,7 +612,6 @@ dependencies = [ "futures-io", "futures-sink", "gloo-utils 0.2.0", - "http 1.0.0", "js-sys", "once_cell", "pin-project", @@ -778,7 +777,7 @@ dependencies = [ "futures-core", "futures-sink", "futures-util", - "http 0.2.11", + "http", "indexmap 2.1.0", "slab", "tokio", @@ -807,7 +806,7 @@ dependencies = [ "base64", "bytes", "headers-core", - "http 0.2.11", + "http", "httpdate", "mime", "sha1", @@ -819,7 +818,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e7f66481bfee273957b1f20485a4ff3362987f85b2c236580d81b4eb7a326429" dependencies = [ - "http 0.2.11", + "http", ] [[package]] @@ -845,17 +844,6 @@ dependencies = [ "itoa", ] -[[package]] -name = "http" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b32afd38673a8016f7c9ae69e5af41a58f81b1d31689040f2f1959594ce194ea" -dependencies = [ - "bytes", - "fnv", - "itoa", -] - [[package]] name = "http-body" version = "0.4.5" @@ -863,7 +851,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" dependencies = [ "bytes", - "http 0.2.11", + "http", "pin-project-lite", ] @@ -890,7 +878,7 @@ dependencies = [ "futures-core", "futures-util", "h2", - "http 0.2.11", + "http", "http-body", "httparse", "httpdate", @@ -1053,7 +1041,7 @@ dependencies = [ "bytes", "encoding_rs", "futures-util", - "http 0.2.11", + "http", "httparse", "log", "memchr", @@ -1703,7 +1691,7 @@ dependencies = [ "byteorder", "bytes", "data-encoding", - "http 0.2.11", + "http", "httparse", "log", "rand", @@ -1791,7 +1779,7 @@ dependencies = [ "futures-channel", "futures-util", "headers", - "http 0.2.11", + "http", "hyper", "log", "mime", diff --git a/crates/net/Cargo.toml b/crates/net/Cargo.toml index 73681ee5..f6a2206f 100644 --- a/crates/net/Cargo.toml +++ b/crates/net/Cargo.toml @@ -36,7 +36,6 @@ serde_json = { version = "1.0", optional = true } futures-channel = { version = "0.3", optional = true } pin-project = { version = "1.0", optional = true } -http = "1.0" [dev-dependencies] wasm-bindgen-test = "0.3" diff --git a/crates/net/src/http/method.rs b/crates/net/src/http/method.rs new file mode 100644 index 00000000..63696195 --- /dev/null +++ b/crates/net/src/http/method.rs @@ -0,0 +1,471 @@ +//! The HTTP request method +//! +//! This module contains HTTP-method related structs and errors and such. The +//! main type of this module, `Method`, is also reexported at the root of the +//! crate as `http::Method` and is intended for import through that location +//! primarily. +//! +//! # Examples +//! +//! ``` +//! use http::Method; +//! +//! assert_eq!(Method::GET, Method::from_bytes(b"GET").unwrap()); +//! assert!(Method::GET.is_idempotent()); +//! assert_eq!(Method::POST.as_str(), "POST"); +//! ``` + +use self::extension::{AllocatedExtension, InlineExtension}; +use self::Inner::*; + +use std::convert::AsRef; +use std::convert::TryFrom; +use std::error::Error; +use std::str::FromStr; +use std::{fmt, str}; + +/// The Request Method (VERB) +/// +/// This type also contains constants for a number of common HTTP methods such +/// as GET, POST, etc. +/// +/// Currently includes 8 variants representing the 8 methods defined in +/// [RFC 7230](https://tools.ietf.org/html/rfc7231#section-4.1), plus PATCH, +/// and an Extension variant for all extensions. +/// +/// # Examples +/// +/// ``` +/// use http::Method; +/// +/// assert_eq!(Method::GET, Method::from_bytes(b"GET").unwrap()); +/// assert!(Method::GET.is_idempotent()); +/// assert_eq!(Method::POST.as_str(), "POST"); +/// ``` +#[derive(Clone, PartialEq, Eq, Hash)] +pub struct Method(Inner); + +/// A possible error value when converting `Method` from bytes. +#[derive(Clone, Copy)] +pub struct InvalidMethod { + _priv: (), +} + +#[derive(Clone, PartialEq, Eq, Hash)] +enum Inner { + Options, + Get, + Post, + Put, + Delete, + Head, + Trace, + Connect, + Patch, + // If the extension is short enough, store it inline + ExtensionInline(InlineExtension), + // Otherwise, allocate it + ExtensionAllocated(AllocatedExtension), +} + +impl Method { + /// GET + pub const GET: Method = Method(Get); + + /// POST + pub const POST: Method = Method(Post); + + /// PUT + pub const PUT: Method = Method(Put); + + /// DELETE + pub const DELETE: Method = Method(Delete); + + /// HEAD + pub const HEAD: Method = Method(Head); + + /// OPTIONS + pub const OPTIONS: Method = Method(Options); + + /// CONNECT + pub const CONNECT: Method = Method(Connect); + + /// PATCH + pub const PATCH: Method = Method(Patch); + + /// TRACE + pub const TRACE: Method = Method(Trace); + + /// Converts a slice of bytes to an HTTP method. + pub fn from_bytes(src: &[u8]) -> Result { + match src.len() { + 0 => Err(InvalidMethod::new()), + 3 => match src { + b"GET" => Ok(Method(Get)), + b"PUT" => Ok(Method(Put)), + _ => Method::extension_inline(src), + }, + 4 => match src { + b"POST" => Ok(Method(Post)), + b"HEAD" => Ok(Method(Head)), + _ => Method::extension_inline(src), + }, + 5 => match src { + b"PATCH" => Ok(Method(Patch)), + b"TRACE" => Ok(Method(Trace)), + _ => Method::extension_inline(src), + }, + 6 => match src { + b"DELETE" => Ok(Method(Delete)), + _ => Method::extension_inline(src), + }, + 7 => match src { + b"OPTIONS" => Ok(Method(Options)), + b"CONNECT" => Ok(Method(Connect)), + _ => Method::extension_inline(src), + }, + _ => { + if src.len() < InlineExtension::MAX { + Method::extension_inline(src) + } else { + let allocated = AllocatedExtension::new(src)?; + + Ok(Method(ExtensionAllocated(allocated))) + } + } + } + } + + fn extension_inline(src: &[u8]) -> Result { + let inline = InlineExtension::new(src)?; + + Ok(Method(ExtensionInline(inline))) + } + + /// Whether a method is considered "safe", meaning the request is + /// essentially read-only. + /// + /// See [the spec](https://tools.ietf.org/html/rfc7231#section-4.2.1) + /// for more words. + pub fn is_safe(&self) -> bool { + matches!(self.0, Get | Head | Options | Trace) + } + + /// Whether a method is considered "idempotent", meaning the request has + /// the same result if executed multiple times. + /// + /// See [the spec](https://tools.ietf.org/html/rfc7231#section-4.2.2) for + /// more words. + pub fn is_idempotent(&self) -> bool { + match self.0 { + Put | Delete => true, + _ => self.is_safe(), + } + } + + /// Return a &str representation of the HTTP method + #[inline] + pub fn as_str(&self) -> &str { + match self.0 { + Options => "OPTIONS", + Get => "GET", + Post => "POST", + Put => "PUT", + Delete => "DELETE", + Head => "HEAD", + Trace => "TRACE", + Connect => "CONNECT", + Patch => "PATCH", + ExtensionInline(ref inline) => inline.as_str(), + ExtensionAllocated(ref allocated) => allocated.as_str(), + } + } +} + +impl AsRef for Method { + #[inline] + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl<'a> PartialEq<&'a Method> for Method { + #[inline] + fn eq(&self, other: &&'a Method) -> bool { + self == *other + } +} + +impl<'a> PartialEq for &'a Method { + #[inline] + fn eq(&self, other: &Method) -> bool { + *self == other + } +} + +impl PartialEq for Method { + #[inline] + fn eq(&self, other: &str) -> bool { + self.as_ref() == other + } +} + +impl PartialEq for str { + #[inline] + fn eq(&self, other: &Method) -> bool { + self == other.as_ref() + } +} + +impl<'a> PartialEq<&'a str> for Method { + #[inline] + fn eq(&self, other: &&'a str) -> bool { + self.as_ref() == *other + } +} + +impl<'a> PartialEq for &'a str { + #[inline] + fn eq(&self, other: &Method) -> bool { + *self == other.as_ref() + } +} + +impl fmt::Debug for Method { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.write_str(self.as_ref()) + } +} + +impl fmt::Display for Method { + fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { + fmt.write_str(self.as_ref()) + } +} + +impl Default for Method { + #[inline] + fn default() -> Method { + Method::GET + } +} + +impl<'a> From<&'a Method> for Method { + #[inline] + fn from(t: &'a Method) -> Self { + t.clone() + } +} + +impl<'a> TryFrom<&'a [u8]> for Method { + type Error = InvalidMethod; + + #[inline] + fn try_from(t: &'a [u8]) -> Result { + Method::from_bytes(t) + } +} + +impl<'a> TryFrom<&'a str> for Method { + type Error = InvalidMethod; + + #[inline] + fn try_from(t: &'a str) -> Result { + TryFrom::try_from(t.as_bytes()) + } +} + +impl FromStr for Method { + type Err = InvalidMethod; + + #[inline] + fn from_str(t: &str) -> Result { + TryFrom::try_from(t) + } +} + +impl InvalidMethod { + fn new() -> InvalidMethod { + InvalidMethod { _priv: () } + } +} + +impl fmt::Debug for InvalidMethod { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + f.debug_struct("InvalidMethod") + // skip _priv noise + .finish() + } +} + +impl fmt::Display for InvalidMethod { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.write_str("invalid HTTP method") + } +} + +impl Error for InvalidMethod {} + +mod extension { + use super::InvalidMethod; + use std::str; + + #[derive(Clone, PartialEq, Eq, Hash)] + // Invariant: the first self.1 bytes of self.0 are valid UTF-8. + pub struct InlineExtension([u8; InlineExtension::MAX], u8); + + #[derive(Clone, PartialEq, Eq, Hash)] + // Invariant: self.0 contains valid UTF-8. + pub struct AllocatedExtension(Box<[u8]>); + + impl InlineExtension { + // Method::from_bytes() assumes this is at least 7 + pub const MAX: usize = 15; + + pub fn new(src: &[u8]) -> Result { + let mut data: [u8; InlineExtension::MAX] = Default::default(); + + write_checked(src, &mut data)?; + + // Invariant: write_checked ensures that the first src.len() bytes + // of data are valid UTF-8. + Ok(InlineExtension(data, src.len() as u8)) + } + + pub fn as_str(&self) -> &str { + let InlineExtension(ref data, len) = self; + // Safety: the invariant of InlineExtension ensures that the first + // len bytes of data contain valid UTF-8. + unsafe { str::from_utf8_unchecked(&data[..*len as usize]) } + } + } + + impl AllocatedExtension { + pub fn new(src: &[u8]) -> Result { + let mut data: Vec = vec![0; src.len()]; + + write_checked(src, &mut data)?; + + // Invariant: data is exactly src.len() long and write_checked + // ensures that the first src.len() bytes of data are valid UTF-8. + Ok(AllocatedExtension(data.into_boxed_slice())) + } + + pub fn as_str(&self) -> &str { + // Safety: the invariant of AllocatedExtension ensures that self.0 + // contains valid UTF-8. + unsafe { str::from_utf8_unchecked(&self.0) } + } + } + + // From the HTTP spec section 5.1.1, the HTTP method is case-sensitive and can + // contain the following characters: + // + // ``` + // method = token + // token = 1*tchar + // tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*" / "+" / "-" / "." / + // "^" / "_" / "`" / "|" / "~" / DIGIT / ALPHA + // ``` + // + // https://www.w3.org/Protocols/HTTP/1.1/draft-ietf-http-v11-spec-01#Method + // + // Note that this definition means that any &[u8] that consists solely of valid + // characters is also valid UTF-8 because the valid method characters are a + // subset of the valid 1 byte UTF-8 encoding. + #[rustfmt::skip] + const METHOD_CHARS: [u8; 256] = [ + // 0 1 2 3 4 5 6 7 8 9 + b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', // x + b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', // 1x + b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', // 2x + b'\0', b'\0', b'\0', b'!', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', // 3x + b'\0', b'\0', b'*', b'+', b'\0', b'-', b'.', b'\0', b'0', b'1', // 4x + b'2', b'3', b'4', b'5', b'6', b'7', b'8', b'9', b'\0', b'\0', // 5x + b'\0', b'\0', b'\0', b'\0', b'\0', b'A', b'B', b'C', b'D', b'E', // 6x + b'F', b'G', b'H', b'I', b'J', b'K', b'L', b'M', b'N', b'O', // 7x + b'P', b'Q', b'R', b'S', b'T', b'U', b'V', b'W', b'X', b'Y', // 8x + b'Z', b'\0', b'\0', b'\0', b'^', b'_', b'`', b'a', b'b', b'c', // 9x + b'd', b'e', b'f', b'g', b'h', b'i', b'j', b'k', b'l', b'm', // 10x + b'n', b'o', b'p', b'q', b'r', b's', b't', b'u', b'v', b'w', // 11x + b'x', b'y', b'z', b'\0', b'|', b'\0', b'~', b'\0', b'\0', b'\0', // 12x + b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', // 13x + b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', // 14x + b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', // 15x + b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', // 16x + b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', // 17x + b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', // 18x + b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', // 19x + b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', // 20x + b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', // 21x + b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', // 22x + b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', // 23x + b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', // 24x + b'\0', b'\0', b'\0', b'\0', b'\0', b'\0' // 25x + ]; + + // write_checked ensures (among other things) that the first src.len() bytes + // of dst are valid UTF-8 + fn write_checked(src: &[u8], dst: &mut [u8]) -> Result<(), InvalidMethod> { + for (i, &b) in src.iter().enumerate() { + let b = METHOD_CHARS[b as usize]; + + if b == 0 { + return Err(InvalidMethod::new()); + } + + dst[i] = b; + } + + Ok(()) + } +} + +#[cfg(test)] +mod test { + use super::*; + + #[test] + fn test_method_eq() { + assert_eq!(Method::GET, Method::GET); + assert_eq!(Method::GET, "GET"); + assert_eq!(&Method::GET, "GET"); + + assert_eq!("GET", Method::GET); + assert_eq!("GET", &Method::GET); + + assert_eq!(&Method::GET, Method::GET); + assert_eq!(Method::GET, &Method::GET); + } + + #[test] + fn test_invalid_method() { + assert!(Method::from_str("").is_err()); + assert!(Method::from_bytes(b"").is_err()); + assert!(Method::from_bytes(&[0xC0]).is_err()); // invalid utf-8 + assert!(Method::from_bytes(&[0x10]).is_err()); // invalid method characters + } + + #[test] + fn test_is_idempotent() { + assert!(Method::OPTIONS.is_idempotent()); + assert!(Method::GET.is_idempotent()); + assert!(Method::PUT.is_idempotent()); + assert!(Method::DELETE.is_idempotent()); + assert!(Method::HEAD.is_idempotent()); + assert!(Method::TRACE.is_idempotent()); + + assert!(!Method::POST.is_idempotent()); + assert!(!Method::CONNECT.is_idempotent()); + assert!(!Method::PATCH.is_idempotent()); + } + + #[test] + fn test_extension_method() { + assert_eq!(Method::from_str("WOW").unwrap(), "WOW"); + assert_eq!(Method::from_str("wOw!!").unwrap(), "wOw!!"); + + let long_method = "This_is_a_very_long_method.It_is_valid_but_unlikely."; + assert_eq!(Method::from_str(long_method).unwrap(), long_method); + } +} \ No newline at end of file diff --git a/crates/net/src/http/mod.rs b/crates/net/src/http/mod.rs index db4ae972..49adb356 100644 --- a/crates/net/src/http/mod.rs +++ b/crates/net/src/http/mod.rs @@ -14,13 +14,14 @@ //! ``` mod headers; +mod method; mod query; mod request; mod response; pub use headers::Headers; -#[doc(inline)] -pub use http::Method; +// This is http 1.0 version Method inlined in gloo-net so we don't need to depend on http crate +pub use method::Method; pub use query::QueryParams; pub use request::{Request, RequestBuilder}; diff --git a/crates/net/src/http/request.rs b/crates/net/src/http/request.rs index 537fc264..b5bf76ec 100644 --- a/crates/net/src/http/request.rs +++ b/crates/net/src/http/request.rs @@ -1,6 +1,5 @@ -use crate::http::{Headers, QueryParams, Response}; +use crate::http::{Headers, Method, QueryParams, Response}; use crate::{js_to_error, Error}; -use http::Method; use js_sys::{ArrayBuffer, Reflect, Uint8Array}; use std::convert::{From, TryFrom, TryInto}; use std::fmt; From f1cdaee24b2a2ce48afb3539fd111ea00710d666 Mon Sep 17 00:00:00 2001 From: Daniel Santana Date: Thu, 30 Nov 2023 11:52:36 +0000 Subject: [PATCH 07/21] chore: cargo fmt --- crates/net/src/http/method.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/net/src/http/method.rs b/crates/net/src/http/method.rs index 63696195..f5f76e7c 100644 --- a/crates/net/src/http/method.rs +++ b/crates/net/src/http/method.rs @@ -468,4 +468,4 @@ mod test { let long_method = "This_is_a_very_long_method.It_is_valid_but_unlikely."; assert_eq!(Method::from_str(long_method).unwrap(), long_method); } -} \ No newline at end of file +} From dfc462cd6cc11b414e6c3383c9892fe8f1c5bbbb Mon Sep 17 00:00:00 2001 From: Daniel Santana Date: Thu, 30 Nov 2023 11:54:29 +0000 Subject: [PATCH 08/21] chore(docs): fixed doc tests --- crates/net/src/http/method.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/net/src/http/method.rs b/crates/net/src/http/method.rs index f5f76e7c..86f76472 100644 --- a/crates/net/src/http/method.rs +++ b/crates/net/src/http/method.rs @@ -8,7 +8,7 @@ //! # Examples //! //! ``` -//! use http::Method; +//! use gloo_net::http::Method; //! //! assert_eq!(Method::GET, Method::from_bytes(b"GET").unwrap()); //! assert!(Method::GET.is_idempotent()); @@ -36,7 +36,7 @@ use std::{fmt, str}; /// # Examples /// /// ``` -/// use http::Method; +/// use gloo_net::http::Method; /// /// assert_eq!(Method::GET, Method::from_bytes(b"GET").unwrap()); /// assert!(Method::GET.is_idempotent()); From 764484ffb83c47e224c13bbb0495ffcf24d5e2dd Mon Sep 17 00:00:00 2001 From: Daniel Santana Date: Thu, 30 Nov 2023 17:08:06 +0000 Subject: [PATCH 09/21] chore: restore lock file to previous state --- Cargo.lock | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cab2e975..cde475e1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -591,7 +591,7 @@ dependencies = [ "futures-core", "futures-sink", "gloo-utils 0.1.7", - "http", + "http 0.2.11", "js-sys", "pin-project", "serde", @@ -612,6 +612,7 @@ dependencies = [ "futures-io", "futures-sink", "gloo-utils 0.2.0", + "http 1.0.0", "js-sys", "once_cell", "pin-project", @@ -777,7 +778,7 @@ dependencies = [ "futures-core", "futures-sink", "futures-util", - "http", + "http 0.2.11", "indexmap 2.1.0", "slab", "tokio", @@ -806,7 +807,7 @@ dependencies = [ "base64", "bytes", "headers-core", - "http", + "http 0.2.11", "httpdate", "mime", "sha1", @@ -818,7 +819,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e7f66481bfee273957b1f20485a4ff3362987f85b2c236580d81b4eb7a326429" dependencies = [ - "http", + "http 0.2.11", ] [[package]] @@ -844,6 +845,17 @@ dependencies = [ "itoa", ] +[[package]] +name = "http" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b32afd38673a8016f7c9ae69e5af41a58f81b1d31689040f2f1959594ce194ea" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + [[package]] name = "http-body" version = "0.4.5" @@ -851,7 +863,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" dependencies = [ "bytes", - "http", + "http 0.2.11", "pin-project-lite", ] @@ -878,7 +890,7 @@ dependencies = [ "futures-core", "futures-util", "h2", - "http", + "http 0.2.11", "http-body", "httparse", "httpdate", @@ -1041,7 +1053,7 @@ dependencies = [ "bytes", "encoding_rs", "futures-util", - "http", + "http 0.2.11", "httparse", "log", "memchr", @@ -1691,7 +1703,7 @@ dependencies = [ "byteorder", "bytes", "data-encoding", - "http", + "http 0.2.11", "httparse", "log", "rand", @@ -1779,7 +1791,7 @@ dependencies = [ "futures-channel", "futures-util", "headers", - "http", + "http 0.2.11", "hyper", "log", "mime", From c5651f7c1f15a7c007fa938dd8466c9fb3f7f917 Mon Sep 17 00:00:00 2001 From: Daniel Santana Date: Thu, 30 Nov 2023 17:16:59 +0000 Subject: [PATCH 10/21] Previous revert missed some of the changes --- Cargo.lock | 440 +++++++++++++++++++++++++++-------------------------- 1 file changed, 227 insertions(+), 213 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cde475e1..0b1a2c60 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "addr2line" -version = "0.21.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +checksum = "f4fa78e18c64fce05e902adecd7a5eed15a5e0a3439f7b0e169f0252214865e3" dependencies = [ "gimli", ] @@ -46,9 +46,9 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "backtrace" -version = "0.3.69" +version = "0.3.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +checksum = "4319208da049c43661739c5fade2ba182f09d1dc2299b32298d3a31692b17e12" dependencies = [ "addr2line", "cc", @@ -61,15 +61,21 @@ dependencies = [ [[package]] name = "base64" -version = "0.21.5" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + +[[package]] +name = "base64" +version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" +checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" [[package]] name = "basic-toml" -version = "0.1.7" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f2139706359229bfa8f19142ac1155b4b80beafb7a60471ac5dd109d4a19778" +checksum = "7bfc506e7a2370ec239e1d072507b2a80c833083699d3c6fa176fbb4de8448c6" dependencies = [ "serde", ] @@ -106,27 +112,27 @@ checksum = "cfa8873f51c92e232f9bac4065cddef41b714152812bfc5f7672ba16d6ef8cd9" [[package]] name = "bumpalo" -version = "3.14.0" +version = "3.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" +checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" [[package]] name = "byteorder" -version = "1.5.0" +version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "bytes" -version = "1.5.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" [[package]] name = "cc" -version = "1.0.83" +version = "1.0.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +checksum = "305fe645edc1442a0fa8b6726ba61d422798d37a52e12eaecf4b022ebbb88f01" dependencies = [ "libc", ] @@ -139,16 +145,17 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.31" +version = "0.4.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" +checksum = "ec837a71355b28f6556dbd569b37b3f363091c0bd4b2e735674521b4c5fd9bc5" dependencies = [ "android-tzdata", "iana-time-zone", "js-sys", "num-traits", + "time", "wasm-bindgen", - "windows-targets", + "winapi", ] [[package]] @@ -169,9 +176,9 @@ checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" [[package]] name = "cpufeatures" -version = "0.2.11" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce420fe07aecd3e67c5f910618fe65e94158f6dcc0adf44e00d69ce2bdfe0fd0" +checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" dependencies = [ "libc", ] @@ -188,9 +195,9 @@ dependencies = [ [[package]] name = "data-encoding" -version = "2.5.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" +checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" [[package]] name = "digest" @@ -204,9 +211,9 @@ dependencies = [ [[package]] name = "encoding_rs" -version = "0.8.33" +version = "0.8.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" +checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394" dependencies = [ "cfg-if", ] @@ -240,7 +247,7 @@ dependencies = [ "hex", "js-sys", "serde", - "serde-wasm-bindgen 0.6.1", + "serde-wasm-bindgen 0.6.0", "sha2", "wasm-bindgen", "wasm-bindgen-futures", @@ -288,18 +295,18 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "form_urlencoded" -version = "1.2.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" dependencies = [ "percent-encoding", ] [[package]] name = "futures" -version = "0.3.29" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0290714b38af9b4a7b094b8a37086d1b4e61f2df9122c3cad2577669145335" +checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" dependencies = [ "futures-channel", "futures-core", @@ -312,9 +319,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.29" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb" +checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" dependencies = [ "futures-core", "futures-sink", @@ -322,15 +329,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.29" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" +checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" [[package]] name = "futures-executor" -version = "0.3.29" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f4fb8693db0cf099eadcca0efe2a5a22e4550f98ed16aba6c48700da29597bc" +checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" dependencies = [ "futures-core", "futures-task", @@ -339,38 +346,38 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.29" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bf34a163b5c4c52d0478a4d757da8fb65cabef42ba90515efee0f6f9fa45aaa" +checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" [[package]] name = "futures-macro" -version = "0.3.29" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53b153fd91e4b0147f4aced87be237c98248656bb01050b96bf3ee89220a8ddb" +checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.29", ] [[package]] name = "futures-sink" -version = "0.3.29" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817" +checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" [[package]] name = "futures-task" -version = "0.3.29" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2" +checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" [[package]] name = "futures-util" -version = "0.3.29" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104" +checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" dependencies = [ "futures-channel", "futures-core", @@ -396,22 +403,22 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.11" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" dependencies = [ "cfg-if", "js-sys", "libc", - "wasi", + "wasi 0.11.0+wasi-snapshot-preview1", "wasm-bindgen", ] [[package]] name = "gimli" -version = "0.28.1" +version = "0.27.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" [[package]] name = "glob" @@ -446,8 +453,8 @@ dependencies = [ "gloo-dialogs 0.2.0", "gloo-events 0.2.0", "gloo-file 0.3.0", - "gloo-history 0.2.1", - "gloo-net 0.5.0", + "gloo-history 0.2.0", + "gloo-net 0.4.0", "gloo-render 0.2.0", "gloo-storage 0.3.0", "gloo-timers 0.3.0", @@ -566,14 +573,14 @@ dependencies = [ [[package]] name = "gloo-history" -version = "0.2.1" +version = "0.2.0" dependencies = [ "getrandom", "gloo-events 0.2.0", "gloo-timers 0.3.0", "gloo-utils 0.2.0", "serde", - "serde-wasm-bindgen 0.6.1", + "serde-wasm-bindgen 0.6.0", "serde_urlencoded", "thiserror", "wasm-bindgen", @@ -591,7 +598,7 @@ dependencies = [ "futures-core", "futures-sink", "gloo-utils 0.1.7", - "http 0.2.11", + "http", "js-sys", "pin-project", "serde", @@ -604,7 +611,7 @@ dependencies = [ [[package]] name = "gloo-net" -version = "0.5.0" +version = "0.4.0" dependencies = [ "futures", "futures-channel", @@ -612,7 +619,7 @@ dependencies = [ "futures-io", "futures-sink", "gloo-utils 0.2.0", - "http 1.0.0", + "http", "js-sys", "once_cell", "pin-project", @@ -763,23 +770,23 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.29", "trybuild", ] [[package]] name = "h2" -version = "0.3.22" +version = "0.3.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d6250322ef6e60f93f9a2162799302cd6f68f79f6e5d85c8c16f14d1d958178" +checksum = "97ec8491ebaf99c8eaa73058b045fe58073cd6be7f596ac993ced0b0a0c01049" dependencies = [ "bytes", "fnv", "futures-core", "futures-sink", "futures-util", - "http 0.2.11", - "indexmap 2.1.0", + "http", + "indexmap 1.9.3", "slab", "tokio", "tokio-util", @@ -794,20 +801,21 @@ checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "hashbrown" -version = "0.14.3" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" [[package]] name = "headers" -version = "0.3.9" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06683b93020a07e3dbcf5f8c0f6d40080d725bea7936fc01ad345c01b97dc270" +checksum = "f3e372db8e5c0d213e0cd0b9be18be2aca3d44cf2fe30a9d46a65581cd454584" dependencies = [ - "base64", + "base64 0.13.1", + "bitflags", "bytes", "headers-core", - "http 0.2.11", + "http", "httpdate", "mime", "sha1", @@ -819,14 +827,14 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e7f66481bfee273957b1f20485a4ff3362987f85b2c236580d81b4eb7a326429" dependencies = [ - "http 0.2.11", + "http", ] [[package]] name = "hermit-abi" -version = "0.3.3" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" +checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" [[package]] name = "hex" @@ -836,20 +844,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "http" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" -dependencies = [ - "bytes", - "fnv", - "itoa", -] - -[[package]] -name = "http" -version = "1.0.0" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b32afd38673a8016f7c9ae69e5af41a58f81b1d31689040f2f1959594ce194ea" +checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" dependencies = [ "bytes", "fnv", @@ -863,7 +860,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" dependencies = [ "bytes", - "http 0.2.11", + "http", "pin-project-lite", ] @@ -890,13 +887,13 @@ dependencies = [ "futures-core", "futures-util", "h2", - "http 0.2.11", + "http", "http-body", "httparse", "httpdate", "itoa", "pin-project-lite", - "socket2 0.4.10", + "socket2 0.4.9", "tokio", "tower-service", "tracing", @@ -905,16 +902,16 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.58" +version = "0.1.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8326b86b6cff230b97d0d312a6c40a60726df3332e721f72a1b035f451663b20" +checksum = "2fad5b825842d2b38bd206f3e81d6957625fd7f0a361e345c30e01a0ae2dd613" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "windows-core", + "windows", ] [[package]] @@ -928,9 +925,9 @@ dependencies = [ [[package]] name = "idna" -version = "0.5.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -957,12 +954,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.1.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" +checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" dependencies = [ "equivalent", - "hashbrown 0.14.3", + "hashbrown 0.14.0", ] [[package]] @@ -973,24 +970,24 @@ checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "js-sys" -version = "0.3.66" +version = "0.3.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cee9c64da59eae3b50095c18d3e74f8b73c0b86d2792824ff01bbce68ba229ca" +checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" dependencies = [ "wasm-bindgen", ] [[package]] name = "libc" -version = "0.2.150" +version = "0.2.147" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" [[package]] name = "lock_api" -version = "0.4.11" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" dependencies = [ "autocfg", "scopeguard", @@ -1004,9 +1001,9 @@ checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "memchr" -version = "2.6.4" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] name = "mime" @@ -1035,12 +1032,12 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.9" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0" +checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" dependencies = [ "libc", - "wasi", + "wasi 0.11.0+wasi-snapshot-preview1", "windows-sys", ] @@ -1053,7 +1050,7 @@ dependencies = [ "bytes", "encoding_rs", "futures-util", - "http 0.2.11", + "http", "httparse", "log", "memchr", @@ -1064,9 +1061,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.17" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" dependencies = [ "autocfg", ] @@ -1083,9 +1080,9 @@ dependencies = [ [[package]] name = "object" -version = "0.32.1" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" +checksum = "8bda667d9f2b5051b8833f59f3bf748b28ef54f850f4fcb389a252aa383866d1" dependencies = [ "memchr", ] @@ -1108,9 +1105,9 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.9" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" dependencies = [ "cfg-if", "libc", @@ -1121,9 +1118,9 @@ dependencies = [ [[package]] name = "percent-encoding" -version = "2.3.1" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" +checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" [[package]] name = "pin-project" @@ -1142,14 +1139,14 @@ checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.29", ] [[package]] name = "pin-project-lite" -version = "0.2.13" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" +checksum = "12cc1b0bf1727a77a54b6654e7b5f1af8604923edc8b81885f8ec92f9e3f0a05" [[package]] name = "pin-utils" @@ -1226,9 +1223,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.70" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39278fbbf5fb4f646ce651690877f89d1c5811a3d4acb27700c1cb3cdb78fd3b" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" dependencies = [ "unicode-ident", ] @@ -1302,9 +1299,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.4.1" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" dependencies = [ "bitflags", ] @@ -1317,11 +1314,11 @@ checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" [[package]] name = "rustls-pemfile" -version = "1.0.4" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" dependencies = [ - "base64", + "base64 0.21.2", ] [[package]] @@ -1350,9 +1347,9 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "serde" -version = "1.0.193" +version = "1.0.183" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" +checksum = "32ac8da02677876d532745a130fc9d8e6edfa81a269b107c5b00829b91d8eb3c" dependencies = [ "serde_derive", ] @@ -1370,9 +1367,9 @@ dependencies = [ [[package]] name = "serde-wasm-bindgen" -version = "0.6.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17ba92964781421b6cef36bf0d7da26d201e96d84e1b10e7ae6ed416e516906d" +checksum = "30c9933e5689bd420dc6c87b7a1835701810cbc10cd86a26e4da45b73e6b1d78" dependencies = [ "js-sys", "serde", @@ -1381,20 +1378,20 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.193" +version = "1.0.183" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" +checksum = "aafe972d60b0b9bee71a91b92fee2d4fb3c9d7e8f6b179aa99f27203d99a4816" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.29", ] [[package]] name = "serde_json" -version = "1.0.108" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" +checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" dependencies = [ "itoa", "ryu", @@ -1415,9 +1412,9 @@ dependencies = [ [[package]] name = "sha1" -version = "0.10.6" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" +checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" dependencies = [ "cfg-if", "cpufeatures", @@ -1446,24 +1443,24 @@ dependencies = [ [[package]] name = "slab" -version = "0.4.9" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" dependencies = [ "autocfg", ] [[package]] name = "smallvec" -version = "1.11.2" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" +checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" [[package]] name = "socket2" -version = "0.4.10" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" +checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" dependencies = [ "libc", "winapi", @@ -1471,9 +1468,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.5" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +checksum = "2538b18701741680e0322a2302176d3253a35388e2e62f172f64f4f16605f877" dependencies = [ "libc", "windows-sys", @@ -1498,9 +1495,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.39" +version = "2.0.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" +checksum = "c324c494eba9d92503e6f1ef2e6df781e78f6a7705a0202d9801b198807d518a" dependencies = [ "proc-macro2", "quote", @@ -1509,31 +1506,42 @@ dependencies = [ [[package]] name = "termcolor" -version = "1.4.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff1bc3d3f05aff0403e8ac0d92ced918ec05b666a43f83297ccef5bea8a3d449" +checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" dependencies = [ "winapi-util", ] [[package]] name = "thiserror" -version = "1.0.50" +version = "1.0.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" +checksum = "97a802ec30afc17eee47b2855fc72e0c4cd62be9b4efe6591edde0ec5bd68d8f" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.50" +version = "1.0.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" +checksum = "6bb623b56e39ab7dcd4b1b98bb6c8f8d907ed255b18de254088016b27a8ee19b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.29", +] + +[[package]] +name = "time" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" +dependencies = [ + "libc", + "wasi 0.10.0+wasi-snapshot-preview1", + "winapi", ] [[package]] @@ -1553,9 +1561,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.34.0" +version = "1.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0c014766411e834f7af5b8f4cf46257aab4036ca95e9d2c144a10f59ad6f5b9" +checksum = "17ed6077ed6cd6c74735e21f37eb16dc3935f96878b1fe961074089cc80893f9" dependencies = [ "backtrace", "bytes", @@ -1565,20 +1573,20 @@ dependencies = [ "parking_lot", "pin-project-lite", "signal-hook-registry", - "socket2 0.5.5", + "socket2 0.5.3", "tokio-macros", "windows-sys", ] [[package]] name = "tokio-macros" -version = "2.2.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" +checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.29", ] [[package]] @@ -1606,9 +1614,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.10" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" +checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" dependencies = [ "bytes", "futures-core", @@ -1620,17 +1628,17 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.5" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" +checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" [[package]] name = "toml_edit" -version = "0.19.15" +version = "0.19.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" +checksum = "f8123f27e969974a3dfba720fdb560be359f57b44302d280ba72e76a74480e8a" dependencies = [ - "indexmap 2.1.0", + "indexmap 2.0.0", "toml_datetime", "winnow", ] @@ -1643,10 +1651,11 @@ checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" -version = "0.1.40" +version = "0.1.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" dependencies = [ + "cfg-if", "log", "pin-project-lite", "tracing-attributes", @@ -1655,20 +1664,20 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.27" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.29", ] [[package]] name = "tracing-core" -version = "0.1.32" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" dependencies = [ "once_cell", ] @@ -1703,7 +1712,7 @@ dependencies = [ "byteorder", "bytes", "data-encoding", - "http 0.2.11", + "http", "httparse", "log", "rand", @@ -1715,15 +1724,15 @@ dependencies = [ [[package]] name = "typenum" -version = "1.17.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" [[package]] name = "unicase" -version = "2.7.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" +checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" dependencies = [ "version_check", ] @@ -1736,9 +1745,9 @@ checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" [[package]] name = "unicode-normalization" @@ -1751,9 +1760,9 @@ dependencies = [ [[package]] name = "url" -version = "2.5.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" dependencies = [ "form_urlencoded", "idna", @@ -1791,7 +1800,7 @@ dependencies = [ "futures-channel", "futures-util", "headers", - "http 0.2.11", + "http", "hyper", "log", "mime", @@ -1812,6 +1821,12 @@ dependencies = [ "tracing", ] +[[package]] +name = "wasi" +version = "0.10.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" + [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -1820,9 +1835,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.89" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ed0d4f68a3015cc185aff4db9506a015f4b96f95303897bfa23f846db54064e" +checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -1830,24 +1845,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.89" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b56f625e64f3a1084ded111c4d5f477df9f8c92df113852fa5a374dbda78826" +checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.29", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.39" +version = "0.4.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac36a15a220124ac510204aec1c3e5db8a22ab06fd6706d881dc6149f8ed9a12" +checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" dependencies = [ "cfg-if", "js-sys", @@ -1857,9 +1872,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.89" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0162dbf37223cd2afce98f3d0785506dcb8d266223983e4b5b525859e6e182b2" +checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1867,28 +1882,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.89" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" +checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.29", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.89" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ab9b36309365056cd639da3134bf87fa8f3d86008abf99e612384a6eecd459f" +checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" [[package]] name = "wasm-bindgen-test" -version = "0.3.39" +version = "0.3.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cf9242c0d27999b831eae4767b2a146feb0b27d332d553e605864acd2afd403" +checksum = "6e6e302a7ea94f83a6d09e78e7dc7d9ca7b186bc2829c24a22d0753efd680671" dependencies = [ "console_error_panic_hook", "js-sys", @@ -1900,13 +1915,12 @@ dependencies = [ [[package]] name = "wasm-bindgen-test-macro" -version = "0.3.39" +version = "0.3.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "794645f5408c9a039fd09f4d113cdfb2e7eba5ff1956b07bcf701cf4b394fe89" +checksum = "ecb993dd8c836930ed130e020e77d9b2e65dd0fbab1b67c790b0f5d80b11a575" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", ] [[package]] @@ -1924,9 +1938,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.65" +version = "0.3.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5db499c5f66323272151db0e666cd34f78617522fb0c1604d31a27c50c206a85" +checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" dependencies = [ "js-sys", "wasm-bindgen", @@ -1950,9 +1964,9 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.6" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" dependencies = [ "winapi", ] @@ -1964,10 +1978,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] -name = "windows-core" -version = "0.51.1" +name = "windows" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" +checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" dependencies = [ "windows-targets", ] @@ -2040,9 +2054,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "winnow" -version = "0.5.19" +version = "0.5.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "829846f3e3db426d4cee4510841b71a8e58aa2a76b1132579487ae430ccd9c7b" +checksum = "d09770118a7eb1ccaf4a594a221334119a44a814fcb0d31c5b85e83e97227a97" dependencies = [ "memchr", ] From e0c381363d71da7eed65ad74c1bb2ca003ef5518 Mon Sep 17 00:00:00 2001 From: Daniel Santana Date: Fri, 1 Dec 2023 16:50:12 +0000 Subject: [PATCH 11/21] Refactor Method. Reactor to be just the required for gloo-net to work. --- crates/net/src/http/method.rs | 510 +++++----------------------------- 1 file changed, 69 insertions(+), 441 deletions(-) diff --git a/crates/net/src/http/method.rs b/crates/net/src/http/method.rs index 86f76472..ef87a70b 100644 --- a/crates/net/src/http/method.rs +++ b/crates/net/src/http/method.rs @@ -1,471 +1,99 @@ -//! The HTTP request method -//! -//! This module contains HTTP-method related structs and errors and such. The -//! main type of this module, `Method`, is also reexported at the root of the -//! crate as `http::Method` and is intended for import through that location -//! primarily. -//! -//! # Examples -//! -//! ``` -//! use gloo_net::http::Method; -//! -//! assert_eq!(Method::GET, Method::from_bytes(b"GET").unwrap()); -//! assert!(Method::GET.is_idempotent()); -//! assert_eq!(Method::POST.as_str(), "POST"); -//! ``` +use std::{fmt::Display, str::FromStr}; -use self::extension::{AllocatedExtension, InlineExtension}; -use self::Inner::*; - -use std::convert::AsRef; -use std::convert::TryFrom; -use std::error::Error; -use std::str::FromStr; -use std::{fmt, str}; - -/// The Request Method (VERB) -/// -/// This type also contains constants for a number of common HTTP methods such -/// as GET, POST, etc. -/// -/// Currently includes 8 variants representing the 8 methods defined in -/// [RFC 7230](https://tools.ietf.org/html/rfc7231#section-4.1), plus PATCH, -/// and an Extension variant for all extensions. -/// -/// # Examples -/// -/// ``` -/// use gloo_net::http::Method; -/// -/// assert_eq!(Method::GET, Method::from_bytes(b"GET").unwrap()); -/// assert!(Method::GET.is_idempotent()); -/// assert_eq!(Method::POST.as_str(), "POST"); -/// ``` -#[derive(Clone, PartialEq, Eq, Hash)] -pub struct Method(Inner); - -/// A possible error value when converting `Method` from bytes. -#[derive(Clone, Copy)] -pub struct InvalidMethod { - _priv: (), -} - -#[derive(Clone, PartialEq, Eq, Hash)] -enum Inner { +/// HTTP methods that can be used in a request. +/// The methods as defined by the [fetch spec](https://fetch.spec.whatwg.org/#methods). +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] +pub enum Method { + /// The OPTIONS method represents a request for information about the communication options Options, + /// The GET method means retrieve whatever information (in the form of an entity) is Get, + /// The POST method is used to request that the origin server accept the entity enclosed Post, + /// The PUT method requests that the enclosed entity be stored under the supplied Request-URI. Put, + /// The DELETE method requests that the origin server delete the resource identified by the Request-URI. Delete, + /// The HEAD method is identical to GET except that the server MUST NOT return a message-body in the response. Head, - Trace, - Connect, + /// The PATCH method requests that a set of changes described in the Patch, - // If the extension is short enough, store it inline - ExtensionInline(InlineExtension), - // Otherwise, allocate it - ExtensionAllocated(AllocatedExtension), } impl Method { - /// GET - pub const GET: Method = Method(Get); - - /// POST - pub const POST: Method = Method(Post); - - /// PUT - pub const PUT: Method = Method(Put); - - /// DELETE - pub const DELETE: Method = Method(Delete); - - /// HEAD - pub const HEAD: Method = Method(Head); - - /// OPTIONS - pub const OPTIONS: Method = Method(Options); - - /// CONNECT - pub const CONNECT: Method = Method(Connect); - - /// PATCH - pub const PATCH: Method = Method(Patch); - - /// TRACE - pub const TRACE: Method = Method(Trace); - - /// Converts a slice of bytes to an HTTP method. - pub fn from_bytes(src: &[u8]) -> Result { - match src.len() { - 0 => Err(InvalidMethod::new()), - 3 => match src { - b"GET" => Ok(Method(Get)), - b"PUT" => Ok(Method(Put)), - _ => Method::extension_inline(src), - }, - 4 => match src { - b"POST" => Ok(Method(Post)), - b"HEAD" => Ok(Method(Head)), - _ => Method::extension_inline(src), - }, - 5 => match src { - b"PATCH" => Ok(Method(Patch)), - b"TRACE" => Ok(Method(Trace)), - _ => Method::extension_inline(src), - }, - 6 => match src { - b"DELETE" => Ok(Method(Delete)), - _ => Method::extension_inline(src), - }, - 7 => match src { - b"OPTIONS" => Ok(Method(Options)), - b"CONNECT" => Ok(Method(Connect)), - _ => Method::extension_inline(src), - }, - _ => { - if src.len() < InlineExtension::MAX { - Method::extension_inline(src) - } else { - let allocated = AllocatedExtension::new(src)?; - - Ok(Method(ExtensionAllocated(allocated))) - } - } - } - } - - fn extension_inline(src: &[u8]) -> Result { - let inline = InlineExtension::new(src)?; - - Ok(Method(ExtensionInline(inline))) - } - - /// Whether a method is considered "safe", meaning the request is - /// essentially read-only. - /// - /// See [the spec](https://tools.ietf.org/html/rfc7231#section-4.2.1) - /// for more words. - pub fn is_safe(&self) -> bool { - matches!(self.0, Get | Head | Options | Trace) - } - - /// Whether a method is considered "idempotent", meaning the request has - /// the same result if executed multiple times. - /// - /// See [the spec](https://tools.ietf.org/html/rfc7231#section-4.2.2) for - /// more words. - pub fn is_idempotent(&self) -> bool { - match self.0 { - Put | Delete => true, - _ => self.is_safe(), + /// Returns a `Method` from the given bytes. + pub fn from_bytes(src: &[u8]) -> Option { + match src { + b"OPTIONS" => Some(Method::Options), + b"GET" => Some(Method::Get), + b"POST" => Some(Method::Post), + b"PUT" => Some(Method::Put), + b"DELETE" => Some(Method::Delete), + b"HEAD" => Some(Method::Head), + b"PATCH" => Some(Method::Patch), + _ => None, } } - /// Return a &str representation of the HTTP method - #[inline] - pub fn as_str(&self) -> &str { - match self.0 { - Options => "OPTIONS", - Get => "GET", - Post => "POST", - Put => "PUT", - Delete => "DELETE", - Head => "HEAD", - Trace => "TRACE", - Connect => "CONNECT", - Patch => "PATCH", - ExtensionInline(ref inline) => inline.as_str(), - ExtensionAllocated(ref allocated) => allocated.as_str(), - } - } + /// The OPTIONS method represents a request for information about the communication options + pub const OPTIONS: Method = Method::Options; + /// The GET method means retrieve whatever information (in the form of an entity) is + /// identified by the Request-URI. + pub const GET: Method = Method::Get; + /// The POST method is used to request that the origin server accept the entity enclosed + /// in the request as a new subordinate of the resource identified by the Request-URI + pub const POST: Method = Method::Post; + /// The PUT method requests that the enclosed entity be stored under the supplied Request-URI. + pub const PUT: Method = Method::Put; + /// The DELETE method requests that the origin server delete the resource identified by the Request-URI. + pub const DELETE: Method = Method::Delete; + /// The HEAD method is identical to GET except that the server MUST NOT return a message-body in the response. + pub const HEAD: Method = Method::Head; + /// The PATCH method requests that a set of changes described in the + /// request entity be applied to the resource identified by the Request-URI. + pub const PATCH: Method = Method::Patch; } impl AsRef for Method { - #[inline] fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl<'a> PartialEq<&'a Method> for Method { - #[inline] - fn eq(&self, other: &&'a Method) -> bool { - self == *other - } -} - -impl<'a> PartialEq for &'a Method { - #[inline] - fn eq(&self, other: &Method) -> bool { - *self == other - } -} - -impl PartialEq for Method { - #[inline] - fn eq(&self, other: &str) -> bool { - self.as_ref() == other - } -} - -impl PartialEq for str { - #[inline] - fn eq(&self, other: &Method) -> bool { - self == other.as_ref() - } -} - -impl<'a> PartialEq<&'a str> for Method { - #[inline] - fn eq(&self, other: &&'a str) -> bool { - self.as_ref() == *other - } -} - -impl<'a> PartialEq for &'a str { - #[inline] - fn eq(&self, other: &Method) -> bool { - *self == other.as_ref() - } -} - -impl fmt::Debug for Method { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.write_str(self.as_ref()) - } -} - -impl fmt::Display for Method { - fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { - fmt.write_str(self.as_ref()) - } -} - -impl Default for Method { - #[inline] - fn default() -> Method { - Method::GET - } -} - -impl<'a> From<&'a Method> for Method { - #[inline] - fn from(t: &'a Method) -> Self { - t.clone() - } -} - -impl<'a> TryFrom<&'a [u8]> for Method { - type Error = InvalidMethod; - - #[inline] - fn try_from(t: &'a [u8]) -> Result { - Method::from_bytes(t) - } -} - -impl<'a> TryFrom<&'a str> for Method { - type Error = InvalidMethod; - - #[inline] - fn try_from(t: &'a str) -> Result { - TryFrom::try_from(t.as_bytes()) + match *self { + Method::Options => "OPTIONS", + Method::Get => "GET", + Method::Post => "POST", + Method::Put => "PUT", + Method::Delete => "DELETE", + Method::Head => "HEAD", + Method::Patch => "PATCH", + } } } impl FromStr for Method { - type Err = InvalidMethod; - - #[inline] - fn from_str(t: &str) -> Result { - TryFrom::try_from(t) - } -} - -impl InvalidMethod { - fn new() -> InvalidMethod { - InvalidMethod { _priv: () } - } -} - -impl fmt::Debug for InvalidMethod { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.debug_struct("InvalidMethod") - // skip _priv noise - .finish() + type Err = Error; + + fn from_str(s: &str) -> Result { + match s { + "OPTIONS" => Ok(Method::Options), + "GET" => Ok(Method::Get), + "POST" => Ok(Method::Post), + "PUT" => Ok(Method::Put), + "DELETE" => Ok(Method::Delete), + "HEAD" => Ok(Method::Head), + "PATCH" => Ok(Method::Patch), + _ => Err(Error::InvalidMethod), + } } } -impl fmt::Display for InvalidMethod { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.write_str("invalid HTTP method") - } +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum Error { + InvalidMethod, } -impl Error for InvalidMethod {} - -mod extension { - use super::InvalidMethod; - use std::str; - - #[derive(Clone, PartialEq, Eq, Hash)] - // Invariant: the first self.1 bytes of self.0 are valid UTF-8. - pub struct InlineExtension([u8; InlineExtension::MAX], u8); - - #[derive(Clone, PartialEq, Eq, Hash)] - // Invariant: self.0 contains valid UTF-8. - pub struct AllocatedExtension(Box<[u8]>); - - impl InlineExtension { - // Method::from_bytes() assumes this is at least 7 - pub const MAX: usize = 15; - - pub fn new(src: &[u8]) -> Result { - let mut data: [u8; InlineExtension::MAX] = Default::default(); - - write_checked(src, &mut data)?; - - // Invariant: write_checked ensures that the first src.len() bytes - // of data are valid UTF-8. - Ok(InlineExtension(data, src.len() as u8)) +impl Display for Error { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + match *self { + Error::InvalidMethod => write!(f, "Invalid method"), } - - pub fn as_str(&self) -> &str { - let InlineExtension(ref data, len) = self; - // Safety: the invariant of InlineExtension ensures that the first - // len bytes of data contain valid UTF-8. - unsafe { str::from_utf8_unchecked(&data[..*len as usize]) } - } - } - - impl AllocatedExtension { - pub fn new(src: &[u8]) -> Result { - let mut data: Vec = vec![0; src.len()]; - - write_checked(src, &mut data)?; - - // Invariant: data is exactly src.len() long and write_checked - // ensures that the first src.len() bytes of data are valid UTF-8. - Ok(AllocatedExtension(data.into_boxed_slice())) - } - - pub fn as_str(&self) -> &str { - // Safety: the invariant of AllocatedExtension ensures that self.0 - // contains valid UTF-8. - unsafe { str::from_utf8_unchecked(&self.0) } - } - } - - // From the HTTP spec section 5.1.1, the HTTP method is case-sensitive and can - // contain the following characters: - // - // ``` - // method = token - // token = 1*tchar - // tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*" / "+" / "-" / "." / - // "^" / "_" / "`" / "|" / "~" / DIGIT / ALPHA - // ``` - // - // https://www.w3.org/Protocols/HTTP/1.1/draft-ietf-http-v11-spec-01#Method - // - // Note that this definition means that any &[u8] that consists solely of valid - // characters is also valid UTF-8 because the valid method characters are a - // subset of the valid 1 byte UTF-8 encoding. - #[rustfmt::skip] - const METHOD_CHARS: [u8; 256] = [ - // 0 1 2 3 4 5 6 7 8 9 - b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', // x - b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', // 1x - b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', // 2x - b'\0', b'\0', b'\0', b'!', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', // 3x - b'\0', b'\0', b'*', b'+', b'\0', b'-', b'.', b'\0', b'0', b'1', // 4x - b'2', b'3', b'4', b'5', b'6', b'7', b'8', b'9', b'\0', b'\0', // 5x - b'\0', b'\0', b'\0', b'\0', b'\0', b'A', b'B', b'C', b'D', b'E', // 6x - b'F', b'G', b'H', b'I', b'J', b'K', b'L', b'M', b'N', b'O', // 7x - b'P', b'Q', b'R', b'S', b'T', b'U', b'V', b'W', b'X', b'Y', // 8x - b'Z', b'\0', b'\0', b'\0', b'^', b'_', b'`', b'a', b'b', b'c', // 9x - b'd', b'e', b'f', b'g', b'h', b'i', b'j', b'k', b'l', b'm', // 10x - b'n', b'o', b'p', b'q', b'r', b's', b't', b'u', b'v', b'w', // 11x - b'x', b'y', b'z', b'\0', b'|', b'\0', b'~', b'\0', b'\0', b'\0', // 12x - b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', // 13x - b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', // 14x - b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', // 15x - b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', // 16x - b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', // 17x - b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', // 18x - b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', // 19x - b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', // 20x - b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', // 21x - b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', // 22x - b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', // 23x - b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', b'\0', // 24x - b'\0', b'\0', b'\0', b'\0', b'\0', b'\0' // 25x - ]; - - // write_checked ensures (among other things) that the first src.len() bytes - // of dst are valid UTF-8 - fn write_checked(src: &[u8], dst: &mut [u8]) -> Result<(), InvalidMethod> { - for (i, &b) in src.iter().enumerate() { - let b = METHOD_CHARS[b as usize]; - - if b == 0 { - return Err(InvalidMethod::new()); - } - - dst[i] = b; - } - - Ok(()) - } -} - -#[cfg(test)] -mod test { - use super::*; - - #[test] - fn test_method_eq() { - assert_eq!(Method::GET, Method::GET); - assert_eq!(Method::GET, "GET"); - assert_eq!(&Method::GET, "GET"); - - assert_eq!("GET", Method::GET); - assert_eq!("GET", &Method::GET); - - assert_eq!(&Method::GET, Method::GET); - assert_eq!(Method::GET, &Method::GET); - } - - #[test] - fn test_invalid_method() { - assert!(Method::from_str("").is_err()); - assert!(Method::from_bytes(b"").is_err()); - assert!(Method::from_bytes(&[0xC0]).is_err()); // invalid utf-8 - assert!(Method::from_bytes(&[0x10]).is_err()); // invalid method characters - } - - #[test] - fn test_is_idempotent() { - assert!(Method::OPTIONS.is_idempotent()); - assert!(Method::GET.is_idempotent()); - assert!(Method::PUT.is_idempotent()); - assert!(Method::DELETE.is_idempotent()); - assert!(Method::HEAD.is_idempotent()); - assert!(Method::TRACE.is_idempotent()); - - assert!(!Method::POST.is_idempotent()); - assert!(!Method::CONNECT.is_idempotent()); - assert!(!Method::PATCH.is_idempotent()); - } - - #[test] - fn test_extension_method() { - assert_eq!(Method::from_str("WOW").unwrap(), "WOW"); - assert_eq!(Method::from_str("wOw!!").unwrap(), "wOw!!"); - - let long_method = "This_is_a_very_long_method.It_is_valid_but_unlikely."; - assert_eq!(Method::from_str(long_method).unwrap(), long_method); } } From f4470d195ac77f872f1115c212b20960e8f47f25 Mon Sep 17 00:00:00 2001 From: Daniel Santana Date: Fri, 1 Dec 2023 16:54:18 +0000 Subject: [PATCH 12/21] chore: Method documentation --- crates/net/src/http/method.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/crates/net/src/http/method.rs b/crates/net/src/http/method.rs index ef87a70b..52d4c6dd 100644 --- a/crates/net/src/http/method.rs +++ b/crates/net/src/http/method.rs @@ -1,14 +1,17 @@ use std::{fmt::Display, str::FromStr}; -/// HTTP methods that can be used in a request. +/// HTTP methods that can be used in a fetch request. /// The methods as defined by the [fetch spec](https://fetch.spec.whatwg.org/#methods). #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] pub enum Method { /// The OPTIONS method represents a request for information about the communication options Options, /// The GET method means retrieve whatever information (in the form of an entity) is + /// identified by the Request-URI. Get, /// The POST method is used to request that the origin server accept the entity enclosed + /// in the request as a new subordinate of the resource identified by the Request-URI + /// in the Request-Line. Post, /// The PUT method requests that the enclosed entity be stored under the supplied Request-URI. Put, @@ -17,6 +20,7 @@ pub enum Method { /// The HEAD method is identical to GET except that the server MUST NOT return a message-body in the response. Head, /// The PATCH method requests that a set of changes described in the + /// request entity be applied to the resource identified by the Request-URI. Patch, } @@ -42,6 +46,7 @@ impl Method { pub const GET: Method = Method::Get; /// The POST method is used to request that the origin server accept the entity enclosed /// in the request as a new subordinate of the resource identified by the Request-URI + /// in the Request-Line. pub const POST: Method = Method::Post; /// The PUT method requests that the enclosed entity be stored under the supplied Request-URI. pub const PUT: Method = Method::Put; @@ -85,6 +90,7 @@ impl FromStr for Method { } } +/// An error that can be returned when converting `Method` from a string slice. #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum Error { InvalidMethod, From fc3949304c230140f12bec2d42c40e5be68ff1fd Mon Sep 17 00:00:00 2001 From: Daniel Santana Date: Fri, 1 Dec 2023 22:02:16 +0000 Subject: [PATCH 13/21] Refactor HTTP methods in net crate --- crates/net/src/http/method.rs | 19 ------------------- crates/net/src/http/mod.rs | 1 - crates/net/src/http/request.rs | 10 +++++----- 3 files changed, 5 insertions(+), 25 deletions(-) diff --git a/crates/net/src/http/method.rs b/crates/net/src/http/method.rs index 52d4c6dd..63c1f726 100644 --- a/crates/net/src/http/method.rs +++ b/crates/net/src/http/method.rs @@ -38,25 +38,6 @@ impl Method { _ => None, } } - - /// The OPTIONS method represents a request for information about the communication options - pub const OPTIONS: Method = Method::Options; - /// The GET method means retrieve whatever information (in the form of an entity) is - /// identified by the Request-URI. - pub const GET: Method = Method::Get; - /// The POST method is used to request that the origin server accept the entity enclosed - /// in the request as a new subordinate of the resource identified by the Request-URI - /// in the Request-Line. - pub const POST: Method = Method::Post; - /// The PUT method requests that the enclosed entity be stored under the supplied Request-URI. - pub const PUT: Method = Method::Put; - /// The DELETE method requests that the origin server delete the resource identified by the Request-URI. - pub const DELETE: Method = Method::Delete; - /// The HEAD method is identical to GET except that the server MUST NOT return a message-body in the response. - pub const HEAD: Method = Method::Head; - /// The PATCH method requests that a set of changes described in the - /// request entity be applied to the resource identified by the Request-URI. - pub const PATCH: Method = Method::Patch; } impl AsRef for Method { diff --git a/crates/net/src/http/mod.rs b/crates/net/src/http/mod.rs index 49adb356..44855f03 100644 --- a/crates/net/src/http/mod.rs +++ b/crates/net/src/http/mod.rs @@ -20,7 +20,6 @@ mod request; mod response; pub use headers::Headers; -// This is http 1.0 version Method inlined in gloo-net so we don't need to depend on http crate pub use method::Method; pub use query::QueryParams; diff --git a/crates/net/src/http/request.rs b/crates/net/src/http/request.rs index b5bf76ec..ee416a8e 100644 --- a/crates/net/src/http/request.rs +++ b/crates/net/src/http/request.rs @@ -223,27 +223,27 @@ pub struct Request(web_sys::Request); impl Request { /// Creates a new [`GET`][Method::GET] `Request` with url. pub fn get(url: &str) -> RequestBuilder { - RequestBuilder::new(url).method(Method::GET) + RequestBuilder::new(url).method(Method::Get) } /// Creates a new [`POST`][Method::POST] `Request` with url. pub fn post(url: &str) -> RequestBuilder { - RequestBuilder::new(url).method(Method::POST) + RequestBuilder::new(url).method(Method::Post) } /// Creates a new [`PUT`][Method::PUT] `Request` with url. pub fn put(url: &str) -> RequestBuilder { - RequestBuilder::new(url).method(Method::PUT) + RequestBuilder::new(url).method(Method::Put) } /// Creates a new [`DELETE`][Method::DELETE] `Request` with url. pub fn delete(url: &str) -> RequestBuilder { - RequestBuilder::new(url).method(Method::DELETE) + RequestBuilder::new(url).method(Method::Delete) } /// Creates a new [`PATCH`][Method::PATCH] `Request` with url. pub fn patch(url: &str) -> RequestBuilder { - RequestBuilder::new(url).method(Method::PATCH) + RequestBuilder::new(url).method(Method::Patch) } /// The URL of the request. From ebdf6cb65ffb69e515c7fe6425ece9b76f7164f0 Mon Sep 17 00:00:00 2001 From: Daniel Santana Date: Fri, 1 Dec 2023 22:03:41 +0000 Subject: [PATCH 14/21] Reverted gloo-net version to 0.4.0 --- Cargo.toml | 2 +- crates/net/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 3737ef68..c002e966 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,7 +23,7 @@ gloo-console = { version = "0.3", path = "crates/console", optional = true } gloo-utils = { version = "0.2", path = "crates/utils", optional = true } gloo-history = { version = "0.2", path = "crates/history", optional = true } gloo-worker = { version = "0.4", path = "crates/worker", optional = true } -gloo-net = { version = "0.5", path = "crates/net", optional = true } +gloo-net = { version = "0.4", path = "crates/net", optional = true } [features] default = [ diff --git a/crates/net/Cargo.toml b/crates/net/Cargo.toml index f6a2206f..55a04d6b 100644 --- a/crates/net/Cargo.toml +++ b/crates/net/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "gloo-net" -version = "0.5.0" +version = "0.4.0" authors = [ "Rust and WebAssembly Working Group", "Muhammad Hamza ", From 92b605d05d6edbc66a6624b892c5295ef4b22ddd Mon Sep 17 00:00:00 2001 From: Daniel Santana Date: Fri, 1 Dec 2023 22:05:35 +0000 Subject: [PATCH 15/21] chore: CHANGELOG update --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e6d1f51..d492ec31 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ ## `console` +### Version 0.4.0 +- Removed http dependency from gloo-net, using a simpler amd lighter Method + ### Version 0.3.0 - Migrate to Edition 2021 and Apply MSRV in Cargo.toml (#360) From 11816de7c5786b631a290a3127ff6a618769be6f Mon Sep 17 00:00:00 2001 From: Daniel Santana Date: Fri, 1 Dec 2023 22:15:27 +0000 Subject: [PATCH 16/21] chore: typo on CHANGELOG --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d492ec31..074317a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ ## `console` ### Version 0.4.0 -- Removed http dependency from gloo-net, using a simpler amd lighter Method +- Removed http dependency from gloo-net, using a simpler and lighter Method ### Version 0.3.0 From 591f607037feb58878b7634995899742183449dc Mon Sep 17 00:00:00 2001 From: Daniel Santana Date: Fri, 1 Dec 2023 22:17:22 +0000 Subject: [PATCH 17/21] fix CHANGELOG for gloo-net --- CHANGELOG.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 074317a9..147a187e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,5 @@ ## `console` -### Version 0.4.0 -- Removed http dependency from gloo-net, using a simpler and lighter Method - ### Version 0.3.0 - Migrate to Edition 2021 and Apply MSRV in Cargo.toml (#360) @@ -156,6 +153,7 @@ ### Version "0.5.0" +- Removed http dependency from gloo-net, using a simpler and lighter Method - Implement `futures_io::AsyncWrite` and `futures_io::AsyncRead` on `WebSocket`. This feature is behind a new feature flag `io-util` that is disabled by default. From eb96badf97b92e885e15dff54d392ae60ecafd86 Mon Sep 17 00:00:00 2001 From: Daniel Santana Date: Mon, 18 Dec 2023 16:53:00 +0000 Subject: [PATCH 18/21] Return to http 1.0 crate. --- Cargo.lock | 6 +-- crates/net/Cargo.toml | 1 + crates/net/src/http/method.rs | 86 ---------------------------------- crates/net/src/http/mod.rs | 4 +- crates/net/src/http/request.rs | 13 ++--- 5 files changed, 13 insertions(+), 97 deletions(-) delete mode 100644 crates/net/src/http/method.rs diff --git a/Cargo.lock b/Cargo.lock index 36e0978e..114c8d0b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -453,7 +453,7 @@ dependencies = [ "gloo-dialogs 0.2.0", "gloo-events 0.2.0", "gloo-file 0.3.0", - "gloo-history 0.2.1", + "gloo-history 0.2.2", "gloo-net 0.5.0", "gloo-render 0.2.0", "gloo-storage 0.3.0", @@ -573,7 +573,7 @@ dependencies = [ [[package]] name = "gloo-history" -version = "0.2.1" +version = "0.2.2" dependencies = [ "getrandom", "gloo-events 0.2.0", @@ -619,7 +619,7 @@ dependencies = [ "futures-io", "futures-sink", "gloo-utils 0.2.0", - "http", + "http 1.0.0", "js-sys", "once_cell", "pin-project", diff --git a/crates/net/Cargo.toml b/crates/net/Cargo.toml index f6a2206f..73681ee5 100644 --- a/crates/net/Cargo.toml +++ b/crates/net/Cargo.toml @@ -36,6 +36,7 @@ serde_json = { version = "1.0", optional = true } futures-channel = { version = "0.3", optional = true } pin-project = { version = "1.0", optional = true } +http = "1.0" [dev-dependencies] wasm-bindgen-test = "0.3" diff --git a/crates/net/src/http/method.rs b/crates/net/src/http/method.rs deleted file mode 100644 index 63c1f726..00000000 --- a/crates/net/src/http/method.rs +++ /dev/null @@ -1,86 +0,0 @@ -use std::{fmt::Display, str::FromStr}; - -/// HTTP methods that can be used in a fetch request. -/// The methods as defined by the [fetch spec](https://fetch.spec.whatwg.org/#methods). -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] -pub enum Method { - /// The OPTIONS method represents a request for information about the communication options - Options, - /// The GET method means retrieve whatever information (in the form of an entity) is - /// identified by the Request-URI. - Get, - /// The POST method is used to request that the origin server accept the entity enclosed - /// in the request as a new subordinate of the resource identified by the Request-URI - /// in the Request-Line. - Post, - /// The PUT method requests that the enclosed entity be stored under the supplied Request-URI. - Put, - /// The DELETE method requests that the origin server delete the resource identified by the Request-URI. - Delete, - /// The HEAD method is identical to GET except that the server MUST NOT return a message-body in the response. - Head, - /// The PATCH method requests that a set of changes described in the - /// request entity be applied to the resource identified by the Request-URI. - Patch, -} - -impl Method { - /// Returns a `Method` from the given bytes. - pub fn from_bytes(src: &[u8]) -> Option { - match src { - b"OPTIONS" => Some(Method::Options), - b"GET" => Some(Method::Get), - b"POST" => Some(Method::Post), - b"PUT" => Some(Method::Put), - b"DELETE" => Some(Method::Delete), - b"HEAD" => Some(Method::Head), - b"PATCH" => Some(Method::Patch), - _ => None, - } - } -} - -impl AsRef for Method { - fn as_ref(&self) -> &str { - match *self { - Method::Options => "OPTIONS", - Method::Get => "GET", - Method::Post => "POST", - Method::Put => "PUT", - Method::Delete => "DELETE", - Method::Head => "HEAD", - Method::Patch => "PATCH", - } - } -} - -impl FromStr for Method { - type Err = Error; - - fn from_str(s: &str) -> Result { - match s { - "OPTIONS" => Ok(Method::Options), - "GET" => Ok(Method::Get), - "POST" => Ok(Method::Post), - "PUT" => Ok(Method::Put), - "DELETE" => Ok(Method::Delete), - "HEAD" => Ok(Method::Head), - "PATCH" => Ok(Method::Patch), - _ => Err(Error::InvalidMethod), - } - } -} - -/// An error that can be returned when converting `Method` from a string slice. -#[derive(Debug, Clone, Copy, PartialEq, Eq)] -pub enum Error { - InvalidMethod, -} - -impl Display for Error { - fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - match *self { - Error::InvalidMethod => write!(f, "Invalid method"), - } - } -} diff --git a/crates/net/src/http/mod.rs b/crates/net/src/http/mod.rs index 44855f03..db4ae972 100644 --- a/crates/net/src/http/mod.rs +++ b/crates/net/src/http/mod.rs @@ -14,13 +14,13 @@ //! ``` mod headers; -mod method; mod query; mod request; mod response; pub use headers::Headers; -pub use method::Method; +#[doc(inline)] +pub use http::Method; pub use query::QueryParams; pub use request::{Request, RequestBuilder}; diff --git a/crates/net/src/http/request.rs b/crates/net/src/http/request.rs index ee416a8e..537fc264 100644 --- a/crates/net/src/http/request.rs +++ b/crates/net/src/http/request.rs @@ -1,5 +1,6 @@ -use crate::http::{Headers, Method, QueryParams, Response}; +use crate::http::{Headers, QueryParams, Response}; use crate::{js_to_error, Error}; +use http::Method; use js_sys::{ArrayBuffer, Reflect, Uint8Array}; use std::convert::{From, TryFrom, TryInto}; use std::fmt; @@ -223,27 +224,27 @@ pub struct Request(web_sys::Request); impl Request { /// Creates a new [`GET`][Method::GET] `Request` with url. pub fn get(url: &str) -> RequestBuilder { - RequestBuilder::new(url).method(Method::Get) + RequestBuilder::new(url).method(Method::GET) } /// Creates a new [`POST`][Method::POST] `Request` with url. pub fn post(url: &str) -> RequestBuilder { - RequestBuilder::new(url).method(Method::Post) + RequestBuilder::new(url).method(Method::POST) } /// Creates a new [`PUT`][Method::PUT] `Request` with url. pub fn put(url: &str) -> RequestBuilder { - RequestBuilder::new(url).method(Method::Put) + RequestBuilder::new(url).method(Method::PUT) } /// Creates a new [`DELETE`][Method::DELETE] `Request` with url. pub fn delete(url: &str) -> RequestBuilder { - RequestBuilder::new(url).method(Method::Delete) + RequestBuilder::new(url).method(Method::DELETE) } /// Creates a new [`PATCH`][Method::PATCH] `Request` with url. pub fn patch(url: &str) -> RequestBuilder { - RequestBuilder::new(url).method(Method::Patch) + RequestBuilder::new(url).method(Method::PATCH) } /// The URL of the request. From 1f79537aa95ea45c1335be7cb5b9e87fb2e77358 Mon Sep 17 00:00:00 2001 From: Daniel Santana Date: Mon, 18 Dec 2023 16:54:31 +0000 Subject: [PATCH 19/21] Updated changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 79ac818a..38ffbb64 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -157,7 +157,7 @@ ### Version "0.5.0" -- Removed http dependency from gloo-net, using a simpler and lighter Method +- Update http crate to 1.0 - Implement `futures_io::AsyncWrite` and `futures_io::AsyncRead` on `WebSocket`. This feature is behind a new feature flag `io-util` that is disabled by default. - Add `TryFrom` (#365) From d452c06c2a9e818c457da253f443b416ed711919 Mon Sep 17 00:00:00 2001 From: Daniel Santana Date: Sun, 24 Dec 2023 09:48:10 +0000 Subject: [PATCH 20/21] Moved changelog version from 0.5.0 to 0.6.0 This is a breaking change so it needs a minor version update. --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 38ffbb64..26572304 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -155,6 +155,10 @@ ## `net` +### Version "0.6.0" + +- Update http crate to 1.0 + ### Version "0.5.0" - Update http crate to 1.0 From 3feb95f3dd5cffe851692d7726358dc914ed7791 Mon Sep 17 00:00:00 2001 From: Daniel Santana Date: Tue, 9 Jan 2024 08:29:48 +0000 Subject: [PATCH 21/21] chore: Changed changelog as requested. --- CHANGELOG.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 26572304..1385f5f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -157,11 +157,10 @@ ### Version "0.6.0" -- Update http crate to 1.0 +- Update http crate to 1.0 (#407) ### Version "0.5.0" -- Update http crate to 1.0 - Implement `futures_io::AsyncWrite` and `futures_io::AsyncRead` on `WebSocket`. This feature is behind a new feature flag `io-util` that is disabled by default. - Add `TryFrom` (#365)