Upgrade actix-web to 3.0.0

This commit is contained in:
Valentin Brandl 2020-09-12 14:01:59 +02:00
parent e06e6736c0
commit b06bbbba8f
3 changed files with 307 additions and 102 deletions

403
Cargo.lock generated
View File

@ -22,18 +22,34 @@ dependencies = [
]
[[package]]
name = "actix-connect"
version = "1.0.2"
name = "actix-codec"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c95cc9569221e9802bf4c377f6c18b90ef10227d787611decf79fd47d2a8e76c"
checksum = "78d1833b3838dbe990df0f1f87baf640cf6146e898166afe401839d1b001e570"
dependencies = [
"actix-codec",
"bitflags",
"bytes",
"futures-core",
"futures-sink",
"log",
"pin-project",
"tokio",
"tokio-util 0.3.1",
]
[[package]]
name = "actix-connect"
version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "177837a10863f15ba8d3ae3ec12fac1099099529ed20083a27fdfe247381d0dc"
dependencies = [
"actix-codec 0.3.0",
"actix-rt",
"actix-service",
"actix-utils",
"actix-utils 2.0.0",
"derive_more",
"either",
"futures",
"futures-util",
"http",
"log",
"trust-dns-proto",
@ -42,26 +58,25 @@ dependencies = [
[[package]]
name = "actix-http"
version = "1.0.1"
version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c16664cc4fdea8030837ad5a845eb231fb93fc3c5c171edfefb52fad92ce9019"
checksum = "05dd80ba8f27c4a34357c07e338c8f5c38f8520e6d626ca1727d8fecc41b0cab"
dependencies = [
"actix-codec",
"actix-codec 0.3.0",
"actix-connect",
"actix-rt",
"actix-service",
"actix-threadpool",
"actix-utils",
"base64 0.11.0",
"actix-utils 2.0.0",
"base64",
"bitflags",
"brotli2",
"bytes",
"chrono",
"cookie",
"copyless",
"derive_more",
"either",
"encoding_rs",
"failure",
"flate2",
"futures-channel",
"futures-core",
@ -71,6 +86,7 @@ dependencies = [
"http",
"httparse",
"indexmap",
"itoa",
"language-tags",
"lazy_static",
"log",
@ -82,9 +98,9 @@ dependencies = [
"serde",
"serde_json",
"serde_urlencoded",
"sha1",
"sha-1",
"slab",
"time",
"time 0.2.19",
]
[[package]]
@ -131,10 +147,10 @@ version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "51d3455eaac03ca3e49d7b822eb35c884b861f715627254ccbe4309d08f1841a"
dependencies = [
"actix-codec",
"actix-codec 0.2.0",
"actix-rt",
"actix-service",
"actix-utils",
"actix-utils 1.0.6",
"futures",
"log",
"mio",
@ -146,9 +162,9 @@ dependencies = [
[[package]]
name = "actix-service"
version = "1.0.5"
version = "1.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d3e4fc95dfa7e24171b2d0bb46b85f8ab0e8499e4e3caec691fc4ea65c287564"
checksum = "0052435d581b5be835d11f4eb3bce417c8af18d87ddf8ace99f8e67e595882bb"
dependencies = [
"futures-util",
"pin-project",
@ -186,18 +202,14 @@ dependencies = [
[[package]]
name = "actix-tls"
version = "1.0.0"
version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a4e5b4faaf105e9a6d389c606c298dcdb033061b00d532af9df56ff3a54995a8"
checksum = "24789b7d7361cf5503a504ebe1c10806896f61e96eca9a7350e23001aca715fb"
dependencies = [
"actix-codec",
"actix-rt",
"actix-codec 0.3.0",
"actix-service",
"actix-utils",
"derive_more",
"either",
"futures",
"log",
"actix-utils 2.0.0",
"futures-util",
]
[[package]]
@ -206,7 +218,7 @@ version = "1.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fcf8f5631bf01adec2267808f00e228b761c60c0584cc9fa0b5364f41d147f4e"
dependencies = [
"actix-codec",
"actix-codec 0.2.0",
"actix-rt",
"actix-service",
"bitflags",
@ -219,12 +231,32 @@ dependencies = [
]
[[package]]
name = "actix-web"
name = "actix-utils"
version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3158e822461040822f0dbf1735b9c2ce1f95f93b651d7a7aded00b1efbb1f635"
checksum = "2e9022dec56632d1d7979e59af14f0597a28a830a9c1c7fec8b2327eb9f16b5a"
dependencies = [
"actix-codec",
"actix-codec 0.3.0",
"actix-rt",
"actix-service",
"bitflags",
"bytes",
"either",
"futures-channel",
"futures-sink",
"futures-util",
"log",
"pin-project",
"slab",
]
[[package]]
name = "actix-web"
version = "3.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2e665de333edabd0421799822dac3e7d8a25a63bb995ae1f60cd99619d8ddda8"
dependencies = [
"actix-codec 0.3.0",
"actix-http",
"actix-macros",
"actix-router",
@ -234,31 +266,34 @@ dependencies = [
"actix-testing",
"actix-threadpool",
"actix-tls",
"actix-utils",
"actix-utils 2.0.0",
"actix-web-codegen",
"awc",
"bytes",
"derive_more",
"encoding_rs",
"futures",
"futures-channel",
"futures-core",
"futures-util",
"fxhash",
"log",
"mime",
"net2",
"pin-project",
"regex",
"serde",
"serde_json",
"serde_urlencoded",
"time",
"socket2",
"time 0.2.19",
"tinyvec",
"url",
]
[[package]]
name = "actix-web-codegen"
version = "0.2.0"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "de0878b30e62623770a4713a6338329fd0119703bafc211d3e4144f4d4a7bdd5"
checksum = "750ca8fb60bbdc79491991650ba5d2ae7cd75f3fc00ead51390cfe9efda0d4d8"
dependencies = [
"proc-macro2",
"quote",
@ -312,9 +347,9 @@ dependencies = [
[[package]]
name = "async-trait"
version = "0.1.24"
version = "0.1.40"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "750b1c38a1dfadd108da0f01c08f4cdc7ff1bb39b325f9c82cc972361780a6e1"
checksum = "687c230d85c0a52504709705fc8a53e4a692b83a2184f03dae73e38e1e93a783"
dependencies = [
"proc-macro2",
"quote",
@ -340,15 +375,15 @@ checksum = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d"
[[package]]
name = "awc"
version = "1.0.1"
version = "2.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d7601d4d1d7ef2335d6597a41b5fe069f6ab799b85f53565ab390e7b7065aac5"
checksum = "150e00c06683ab44c5f97d033950e5d87a7a042d06d77f5eecb443cbd23d0575"
dependencies = [
"actix-codec",
"actix-codec 0.3.0",
"actix-http",
"actix-rt",
"actix-service",
"base64 0.11.0",
"base64",
"bytes",
"derive_more",
"futures-core",
@ -389,16 +424,16 @@ version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d0228ae65b89e72921e86c19c3574da63bda0628e9d7da5e164f569bbf4e477d"
dependencies = [
"base64 0.12.0",
"base64",
"once_cell",
"rusttype",
]
[[package]]
name = "base64"
version = "0.11.0"
name = "base-x"
version = "0.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b41b7ea54a0c9d92199de89e20e58d49f02f8e699814ef3fdf266f6f748d15c7"
checksum = "1b20b618342cf9891c292c4f5ac2cde7287cc5c87e87e9c769d617793607dec1"
[[package]]
name = "base64"
@ -412,6 +447,15 @@ version = "1.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693"
[[package]]
name = "block-buffer"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4"
dependencies = [
"generic-array",
]
[[package]]
name = "brotli-sys"
version = "0.3.2"
@ -497,7 +541,7 @@ checksum = "31850b4a4d6bae316f7a09e691c944c28299298837edc0a03f755618c23cbc01"
dependencies = [
"num-integer",
"num-traits",
"time",
"time 0.1.42",
]
[[package]]
@ -533,6 +577,23 @@ dependencies = [
"bitflags",
]
[[package]]
name = "const_fn"
version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ce90df4c658c62f12d78f7508cf92f9173e5184a539c10bfe54a3107b3ffd0f2"
[[package]]
name = "cookie"
version = "0.14.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1373a16a4937bc34efec7b391f9c1500c30b8478a701a4f44c9165cc0475a6e0"
dependencies = [
"percent-encoding",
"time 0.2.19",
"version_check 0.9.1",
]
[[package]]
name = "copyless"
version = "0.1.4"
@ -555,6 +616,12 @@ version = "0.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e7ca8a5221364ef15ce201e8ed2f609fc312682a8f4e0e3d4aa5879764e0fa3b"
[[package]]
name = "cpuid-bool"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8aebca1129a03dc6dc2b127edd729435bbc4a37e1d5f4d7513165089ceb02634"
[[package]]
name = "crc32fast"
version = "1.2.0"
@ -575,6 +642,21 @@ dependencies = [
"syn",
]
[[package]]
name = "digest"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066"
dependencies = [
"generic-array",
]
[[package]]
name = "discard"
version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "212d0f5754cb6769937f4501cc0e67f4f4483c8d2c3e1e922ee9edbe4ab4c7c0"
[[package]]
name = "dtoa"
version = "0.4.5"
@ -608,28 +690,6 @@ dependencies = [
"syn",
]
[[package]]
name = "failure"
version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f8273f13c977665c5db7eb2b99ae520952fe5ac831ae4cd09d80c4c7042b5ed9"
dependencies = [
"backtrace",
"failure_derive",
]
[[package]]
name = "failure_derive"
version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0bc225b78e0391e4b8683440bf2e63c2deeeb2ce5189eab46e2b68c6d3725d08"
dependencies = [
"proc-macro2",
"quote",
"syn",
"synstructure",
]
[[package]]
name = "flate2"
version = "1.0.13"
@ -783,6 +843,16 @@ dependencies = [
"byteorder",
]
[[package]]
name = "generic-array"
version = "0.14.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "501466ecc8a30d1d3b7fc9229b122b2ce8ed6e9d9223f1138d4babb253e51817"
dependencies = [
"typenum",
"version_check 0.9.1",
]
[[package]]
name = "getrandom"
version = "0.1.14"
@ -935,7 +1005,7 @@ dependencies = [
"log",
"net2",
"pin-project",
"time",
"time 0.1.42",
"tokio",
"tower-service",
"want",
@ -1377,6 +1447,12 @@ version = "1.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b1c601810575c99596d4afc46f78a678c80105117c379eb3650cf99b8a21ce5b"
[[package]]
name = "opaque-debug"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5"
[[package]]
name = "openssl"
version = "0.10.28"
@ -1486,18 +1562,18 @@ checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e"
[[package]]
name = "pin-project"
version = "0.4.8"
version = "0.4.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7804a463a8d9572f13453c516a5faea534a2403d7ced2f0c7e100eeff072772c"
checksum = "ca4433fff2ae79342e497d9f8ee990d174071408f28f726d6d83af93e58e48aa"
dependencies = [
"pin-project-internal",
]
[[package]]
name = "pin-project-internal"
version = "0.4.8"
version = "0.4.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "385322a45f2ecf3410c68d2a549a4a2685e8051d0f278e39743ff4e451cb9b3f"
checksum = "2c0e815c3ee9a031fdf5af21c10aa17c573c9c6a566328d99e3936c34e36461f"
dependencies = [
"proc-macro2",
"quote",
@ -1675,7 +1751,7 @@ version = "0.10.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e9eaa17ac5d7b838b7503d118fa16ad88f440498bf9ffe5424e621f93190d61e"
dependencies = [
"base64 0.12.0",
"base64",
"bytes",
"encoding_rs",
"futures-core",
@ -1720,7 +1796,7 @@ version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1b8ffc645837eab09b6cbb6772d18897c6309753254592e149b40ff7fb113c01"
dependencies = [
"base64 0.12.0",
"base64",
"bytecount",
"itertools",
"md5",
@ -1875,6 +1951,19 @@ dependencies = [
"yaml-rust",
]
[[package]]
name = "sha-1"
version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "170a36ea86c864a3f16dd2687712dd6646f7019f301e57537c7f4dc9f5916770"
dependencies = [
"block-buffer",
"cfg-if",
"cpuid-bool",
"digest",
"opaque-debug",
]
[[package]]
name = "sha1"
version = "0.6.0"
@ -1921,12 +2010,67 @@ version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4bf77cb82ba8453b42b6ae1d692e4cdc92f9a47beaf89a847c8be83f4e328ad3"
[[package]]
name = "standback"
version = "0.2.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "47e4b8c631c998468961a9ea159f064c5c8499b95b5e4a34b77849d45949d540"
[[package]]
name = "static_assertions"
version = "0.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7f3eb36b47e512f8f1c9e3d10c2c1965bc992bd9cdb024fa581e2194501c83d3"
[[package]]
name = "stdweb"
version = "0.4.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d022496b16281348b52d0e30ae99e01a73d737b2f45d38fed4edf79f9325a1d5"
dependencies = [
"discard",
"rustc_version",
"stdweb-derive",
"stdweb-internal-macros",
"stdweb-internal-runtime",
"wasm-bindgen",
]
[[package]]
name = "stdweb-derive"
version = "0.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c87a60a40fccc84bef0652345bbbbbe20a605bf5d0ce81719fc476f5c03b50ef"
dependencies = [
"proc-macro2",
"quote",
"serde",
"serde_derive",
"syn",
]
[[package]]
name = "stdweb-internal-macros"
version = "0.2.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "58fa5ff6ad0d98d1ffa8cb115892b6e69d67799f6763e162a1c9db421dc22e11"
dependencies = [
"base-x",
"proc-macro2",
"quote",
"serde",
"serde_derive",
"serde_json",
"sha1",
"syn",
]
[[package]]
name = "stdweb-internal-runtime"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "213701ba3370744dcd1a12960caa4843b3d68b4d1c0a5d575e0d65b2ee9d16c0"
[[package]]
name = "strsim"
version = "0.8.0"
@ -1979,18 +2123,6 @@ dependencies = [
"syn",
]
[[package]]
name = "synstructure"
version = "0.12.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "67656ea1dc1b41b1451851562ea232ec2e5a80242139f7e679ceccfb5d61f545"
dependencies = [
"proc-macro2",
"quote",
"syn",
"unicode-xid",
]
[[package]]
name = "tempfile"
version = "3.1.0"
@ -2014,6 +2146,26 @@ dependencies = [
"unicode-width",
]
[[package]]
name = "thiserror"
version = "1.0.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7dfdd070ccd8ccb78f4ad66bf1982dc37f620ef696c6b5028fe2ed83dd3d0d08"
dependencies = [
"thiserror-impl",
]
[[package]]
name = "thiserror-impl"
version = "1.0.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bd80fc12f73063ac132ac92aceea36734f04a1d93c1240c6944e23a3b8841793"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "thread-id"
version = "3.3.0"
@ -2055,10 +2207,54 @@ dependencies = [
]
[[package]]
name = "tokio"
version = "0.2.11"
name = "time"
version = "0.2.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8fdd17989496f49cdc57978c96f0c9fe5e4a58a8bddc6813c449a4624f6a030b"
checksum = "80c1a1fd93112fc50b11c43a1def21f926be3c18884fad676ea879572da070a1"
dependencies = [
"const_fn",
"libc",
"standback",
"stdweb",
"time-macros",
"version_check 0.9.1",
"winapi 0.3.8",
]
[[package]]
name = "time-macros"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9ae9b6e9f095bc105e183e3cd493d72579be3181ad4004fceb01adbe9eecab2d"
dependencies = [
"proc-macro-hack",
"time-macros-impl",
]
[[package]]
name = "time-macros-impl"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e5c3be1edfad6027c69f5491cf4cb310d1a71ecd6af742788c6ff8bced86b8fa"
dependencies = [
"proc-macro-hack",
"proc-macro2",
"quote",
"standback",
"syn",
]
[[package]]
name = "tinyvec"
version = "0.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "238ce071d267c5710f9d31451efec16c5ee22de34df17cc05e56cbc92e967117"
[[package]]
name = "tokio"
version = "0.2.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5d34ca54d84bf2b5b4d7d31e901a8464f7b60ac145a284fba25ceb801f2ddccd"
dependencies = [
"bytes",
"fnv",
@ -2127,32 +2323,32 @@ checksum = "efd1f82c56340fdf16f2a953d7bda4f8fdffba13d93b00844c25572110b26079"
[[package]]
name = "trust-dns-proto"
version = "0.18.0-alpha.2"
version = "0.19.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2a7f3a2ab8a919f5eca52a468866a67ed7d3efa265d48a652a9a3452272b413f"
checksum = "cdd7061ba6f4d4d9721afedffbfd403f20f39a4301fee1b70d6fcd09cca69f28"
dependencies = [
"async-trait",
"backtrace",
"enum-as-inner",
"failure",
"futures",
"idna",
"lazy_static",
"log",
"rand",
"smallvec",
"socket2",
"thiserror",
"tokio",
"url",
]
[[package]]
name = "trust-dns-resolver"
version = "0.18.0-alpha.2"
version = "0.19.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6f90b1502b226f8b2514c6d5b37bafa8c200d7ca4102d57dc36ee0f3b7a04a2f"
checksum = "0f23cdfdc3d8300b3c50c9e84302d3bd6d860fb9529af84ace6cf9665f181b77"
dependencies = [
"backtrace",
"cfg-if",
"failure",
"futures",
"ipconfig",
"lazy_static",
@ -2160,6 +2356,7 @@ dependencies = [
"lru-cache",
"resolv-conf",
"smallvec",
"thiserror",
"tokio",
"trust-dns-proto",
]
@ -2185,6 +2382,12 @@ dependencies = [
"unsafe-any",
]
[[package]]
name = "typenum"
version = "1.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "373c8a200f9e67a0c95e62a4f52fbf80c23b4381c05a17845531982fa99e6b33"
[[package]]
name = "unicase"
version = "2.6.0"

View File

@ -6,7 +6,7 @@ edition = "2018"
build = "build.rs"
[dependencies]
actix-web = "2.0.0"
actix-web = "3.0.0"
badge = "0.3.0"
bytes = "0.5.6"
futures = "0.3.5"

View File

@ -178,6 +178,7 @@ async fn delete_repo_and_cache<T>(
where
T: Service,
{
let data = data.into_inner();
let repo = format!(
"{}/{}/{}",
T::domain(),
@ -220,6 +221,7 @@ where
T: Service,
F: Fn(HocResult) -> Result<HttpResponse>,
{
let data = data.into_inner();
let repo = format!("{}/{}", data.0.to_lowercase(), data.1.to_lowercase());
let service_path = format!("{}/{}", T::url_path(), repo);
let service_url = format!("{}/{}", T::domain(), repo);
@ -412,7 +414,7 @@ async fn start_server() -> std::io::Result<()> {
App::new()
.data(state.clone())
.wrap(middleware::Logger::default())
.wrap(middleware::NormalizePath)
.wrap(middleware::NormalizePath::default())
.service(index)
.service(css)
.service(favicon32)