From 4b37c8073fe186d6de58fbaf6b6d5a7afe45c527 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 1 Feb 2022 04:14:37 +0000 Subject: [PATCH 1/5] Bump awc from 3.0.0-beta.19 to 3.0.0-beta.20 Bumps [awc](https://github.com/actix/actix-web) from 3.0.0-beta.19 to 3.0.0-beta.20. - [Release notes](https://github.com/actix/actix-web/releases) - [Changelog](https://github.com/actix/actix-web/blob/master/CHANGES.md) - [Commits](https://github.com/actix/actix-web/compare/awc-v3.0.0-beta.19...awc-v3.0.0-beta.20) --- updated-dependencies: - dependency-name: awc dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Cargo.lock | 8 ++++---- Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ce507a4..43871d4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -27,9 +27,9 @@ dependencies = [ [[package]] name = "actix-http" -version = "3.0.0-beta.19" +version = "3.0.0-rc.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae58d21721388ea9b2cd0d4c11756b0f34424cdcd6e5cc74c3ce37b4641c8af0" +checksum = "08aac516b88cb8cfbfa834c76b58607ffac75946d947dcb6a9ffc5673e1e875d" dependencies = [ "actix-codec", "actix-rt", @@ -274,9 +274,9 @@ checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" [[package]] name = "awc" -version = "3.0.0-beta.19" +version = "3.0.0-beta.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a4cf9b623ee9974723a10c77a3b8c1060ac2d6cfe6d3326512bbc50fe36fad8" +checksum = "4a64a95bbf4905fd057ea45b70fdfeeb9c7ae09f03f091642c4e66a16ebb3ad5" dependencies = [ "actix-codec", "actix-http", diff --git a/Cargo.toml b/Cargo.toml index df05f15..7d61ac5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -40,7 +40,7 @@ ructe = "0.13.4" vergen = { version = "6.0.2", default-features = false, features = ["git"] } [dev-dependencies] -awc = "3.0.0-beta.19" +awc = "3.0.0-beta.20" ructe = "0.13.4" tempfile = "3.3.0" tokio = "1.16.1" From d78b349ca16e5ab4529f49b361e02ad93be7ef2f Mon Sep 17 00:00:00 2001 From: Valentin Brandl Date: Tue, 1 Feb 2022 19:16:11 +0100 Subject: [PATCH 2/5] Update other actix dependencies --- Cargo.lock | 24 ++++++++++++------------ Cargo.toml | 4 ++-- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 43871d4..cb5cd20 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -74,9 +74,9 @@ dependencies = [ [[package]] name = "actix-router" -version = "0.5.0-rc.2" +version = "0.5.0-rc.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e0b59ad08167ffbb686ddb495846707231e96908b829b1fc218198ec581e2ad" +checksum = "cb6506dbef336634ff35d994d58daa0a412ea23751f15f9b4dcac4d594b1ed1f" dependencies = [ "bytestring", "firestorm", @@ -155,9 +155,9 @@ dependencies = [ [[package]] name = "actix-web" -version = "4.0.0-beta.21" +version = "4.0.0-rc.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "606fc29a9bde2907243086ceb93ce56df7584276c2c46abc64a524f645c63c5e" +checksum = "d7bfa913583b6cfe5f0d1588e752bcf6b107556422624fefdaf99c40ba2b7f16" dependencies = [ "actix-codec", "actix-http", @@ -194,9 +194,9 @@ dependencies = [ [[package]] name = "actix-web-codegen" -version = "0.5.0-rc.1" +version = "0.5.0-rc.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98a793e4a7bd059e06e1bc1bd9943b57a47f806de3599d2437441682292c333e" +checksum = "4d0976042e6ddc82c7d0dedd64d39959bc26d9bba098b2f6c32a73fbef784eaf" dependencies = [ "actix-router", "proc-macro2", @@ -1656,9 +1656,9 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] name = "security-framework" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d09d3c15d814eda1d6a836f2f2b56a6abc1446c8a34351cb3180d3db92ffe4ce" +checksum = "3fed7948b6c68acbb6e20c334f55ad635dc0f75506963de4464289fbd3b051ac" dependencies = [ "bitflags", "core-foundation", @@ -1669,9 +1669,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e90dd10c41c6bfc633da6e0c659bd25d31e0791e5974ac42970267d59eba87f7" +checksum = "a57321bf8bc2362081b2599912d2961fe899c0efadf1b4b2f8d48b3e253bb96c" dependencies = [ "core-foundation-sys", "libc", @@ -1975,9 +1975,9 @@ dependencies = [ [[package]] name = "tracing-actix-web" -version = "0.5.0-beta.11" +version = "0.5.0-rc.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71f2dfaaf009c5e9786e2f2dfbde63d5fa44409434d64190abfef5ade67d89b1" +checksum = "0066b8102bdd05325d02966fac8b5e360eafd8dcdf81006c4d30f3543f488714" dependencies = [ "actix-web", "pin-project", diff --git a/Cargo.toml b/Cargo.toml index 7d61ac5..b1b74c3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,7 +14,7 @@ name = "hoc" [dependencies] actix-rt = "2.6.0" -actix-web = "4.0.0-beta.21" +actix-web = "4.0.0-rc.1" badge = "0.3.0" bytes = "1.1.0" config = { version = "0.11.0", features = ["toml"] } @@ -29,7 +29,7 @@ serde = "1.0.136" serde_derive = "1.0.136" serde_json = "1.0.78" tracing = "0.1.29" -tracing-actix-web = "0.5.0-beta.11" +tracing-actix-web = "0.5.0-rc.1" tracing-bunyan-formatter = "0.3.2" tracing-futures = "0.2.5" tracing-log = "0.1.2" From 2507c24de7e58d01c7cb4cb92d13b1e959dd10af Mon Sep 17 00:00:00 2001 From: Valentin Brandl Date: Tue, 1 Feb 2022 19:16:26 +0100 Subject: [PATCH 3/5] Fix function signature https://github.com/actix/actix-web/pull/2601 --- src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 301b000..ccc58fe 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -462,11 +462,11 @@ async fn async_p404(repo_count: web::Data) -> Result p404(repo_count) } -fn css() -> HttpResponse { +async fn css() -> HttpResponse { HttpResponse::Ok().content_type("text/css").body(CSS) } -fn favicon32() -> HttpResponse { +async fn favicon32() -> HttpResponse { HttpResponse::Ok().content_type("image/png").body(FAVICON) } From 1e44bc1a8f2634e4b60b886dbb3d35abe55e0df8 Mon Sep 17 00:00:00 2001 From: Valentin Brandl Date: Tue, 1 Feb 2022 19:16:47 +0100 Subject: [PATCH 4/5] Add test if resources are available --- tests/resources.rs | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 tests/resources.rs diff --git a/tests/resources.rs b/tests/resources.rs new file mode 100644 index 0000000..9765f3c --- /dev/null +++ b/tests/resources.rs @@ -0,0 +1,31 @@ +mod util; + +#[actix_rt::test] +async fn favicon() { + let test_app = util::spawn_app().await; + + let client = awc::Client::default(); + + let response = client + .get(&format!("{}/favicon.ico", test_app.address)) + .send() + .await + .expect("Failed to execute request"); + + assert!(response.status().is_success()); +} + +#[actix_rt::test] +async fn tacit_css() { + let test_app = util::spawn_app().await; + + let client = awc::Client::default(); + + let response = client + .get(&format!("{}/tacit-css.min.css", test_app.address)) + .send() + .await + .expect("Failed to execute request"); + + assert!(response.status().is_success()); +} From 815b213a2a20f3033f5dfdc903a39ce909b4455a Mon Sep 17 00:00:00 2001 From: Valentin Brandl Date: Tue, 1 Feb 2022 19:23:04 +0100 Subject: [PATCH 5/5] Fix clippy lint --- src/lib.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index ccc58fe..5171f0b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -491,8 +491,7 @@ async fn start_server(listener: TcpListener, settings: Settings) -> std::io::Res let app = GitHub::register_service(app); let app = Gitlab::register_service(app); let app = Bitbucket::register_service(app); - let app = Sourcehut::register_service(app); - app + Sourcehut::register_service(app) }) .workers(workers) .listen(listener)?