Skip to content

Commit

Permalink
Update to tower-http 0.3.0 (#965)
Browse files Browse the repository at this point in the history
* Update to tower-http 0.3.0

* changelog link
  • Loading branch information
davidpdrsn committed Apr 25, 2022
1 parent ebecac5 commit 79f6cde
Show file tree
Hide file tree
Showing 14 changed files with 18 additions and 16 deletions.
2 changes: 1 addition & 1 deletion axum-extra/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ http = "0.2"
mime = "0.3"
pin-project-lite = "0.2"
tower = { version = "0.4", default_features = false, features = ["util"] }
tower-http = { version = "0.2", features = ["map-response-body"] }
tower-http = { version = "0.3", features = ["map-response-body"] }
tower-layer = "0.3"
tower-service = "0.3"

Expand Down
2 changes: 2 additions & 0 deletions axum/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- **added:** Add `response::ErrorResponse` and `response::Result` for
`IntoResponse`-based error handling ([#921])
- **added:** Add `middleware::from_extractor` and deprecate `extract::extractor_middleware` ([#957])
- **changed:** Update to tower-http 0.3 ([#965])

[#921]: https://github.com/tokio-rs/axum/pull/921
[#957]: https://github.com/tokio-rs/axum/pull/957
[#965]: https://github.com/tokio-rs/axum/pull/965

# 0.5.3 (19. April, 2022)

Expand Down
4 changes: 2 additions & 2 deletions axum/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ serde = "1.0"
sync_wrapper = "0.1.1"
tokio = { version = "1", features = ["time"] }
tower = { version = "0.4.11", default-features = false, features = ["util", "buffer", "make"] }
tower-http = { version = "0.2.0", features = ["util", "map-response-body"] }
tower-http = { version = "0.3.0", features = ["util", "map-response-body"] }
tower-layer = "0.3"
tower-service = "0.3"

Expand Down Expand Up @@ -81,7 +81,7 @@ features = [
]

[dev-dependencies.tower-http]
version = "0.2.0"
version = "0.3.0"
features = ["full"]

[package.metadata.docs.rs]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ axum = { path = "../../axum" }
hyper = "0.14"
tokio = { version = "1.0", features = ["full"] }
tower = "0.4"
tower-http = { version = "0.2", features = ["map-request-body", "util"] }
tower-http = { version = "0.3", features = ["map-request-body", "util"] }
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
2 changes: 1 addition & 1 deletion examples/cors/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ publish = false
[dependencies]
axum = { path = "../../axum" }
tokio = { version = "1.0", features = ["full"] }
tower-http = { version = "0.2.0", features = ["cors"] }
tower-http = { version = "0.3.0", features = ["cors"] }
6 changes: 3 additions & 3 deletions examples/cors/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
//! ```

use axum::{
http::Method,
http::{HeaderValue, Method},
response::{Html, IntoResponse},
routing::get,
Json, Router,
};
use std::net::SocketAddr;
use tower_http::cors::{CorsLayer, Origin};
use tower_http::cors::CorsLayer;

#[tokio::main]
async fn main() {
Expand All @@ -29,7 +29,7 @@ async fn main() {
// it is required to add ".allow_headers(vec![http::header::CONTENT_TYPE])"
// or see this issue https://github.com/tokio-rs/axum/issues/849
CorsLayer::new()
.allow_origin(Origin::exact("http://localhost:3000".parse().unwrap()))
.allow_origin("http://localhost:3000".parse::<HeaderValue>().unwrap())
.allow_methods(vec![Method::GET]),
);
serve(app, 4000).await;
Expand Down
2 changes: 1 addition & 1 deletion examples/key-value-store/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ tokio = { version = "1.0", features = ["full"] }
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
tower = { version = "0.4", features = ["util", "timeout", "load-shed", "limit"] }
tower-http = { version = "0.2.0", features = ["add-extension", "auth", "compression-full", "trace"] }
tower-http = { version = "0.3.0", features = ["add-extension", "auth", "compression-full", "trace"] }
2 changes: 1 addition & 1 deletion examples/multipart-form/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ axum = { path = "../../axum", features = ["multipart"] }
tokio = { version = "1.0", features = ["full"] }
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
tower-http = { version = "0.2.0", features = ["trace"] }
tower-http = { version = "0.3.0", features = ["trace"] }
2 changes: 1 addition & 1 deletion examples/sse/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ axum = { path = "../../axum", features = ["headers"] }
tokio = { version = "1.0", features = ["full"] }
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
tower-http = { version = "0.2.0", features = ["fs", "trace"] }
tower-http = { version = "0.3.0", features = ["fs", "trace"] }
futures = "0.3"
tokio-stream = "0.1"
headers = "0.3"
2 changes: 1 addition & 1 deletion examples/static-file-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ axum = { path = "../../axum" }
tokio = { version = "1.0", features = ["full"] }
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
tower-http = { version = "0.2.0", features = ["fs", "trace"] }
tower-http = { version = "0.3.0", features = ["fs", "trace"] }
2 changes: 1 addition & 1 deletion examples/testing/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ mime = "0.3"
tokio = { version = "1.0", features = ["full"] }
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
tower-http = { version = "0.2.0", features = ["trace"] }
tower-http = { version = "0.3.0", features = ["trace"] }
serde_json = "1.0"
hyper = { version = "0.14", features = ["full"] }

Expand Down
2 changes: 1 addition & 1 deletion examples/todos/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ tokio = { version = "1.0", features = ["full"] }
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
tower = { version = "0.4", features = ["util", "timeout"] }
tower-http = { version = "0.2.0", features = ["add-extension", "trace"] }
tower-http = { version = "0.3.0", features = ["add-extension", "trace"] }
uuid = { version = "0.8", features = ["serde", "v4"] }
serde = { version = "1.0", features = ["derive"] }
2 changes: 1 addition & 1 deletion examples/tracing-aka-logging/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ axum = { path = "../../axum" }
tokio = { version = "1.0", features = ["full"] }
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
tower-http = { version = "0.2.0", features = ["trace"] }
tower-http = { version = "0.3.0", features = ["trace"] }
2 changes: 1 addition & 1 deletion examples/websockets/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ axum = { path = "../../axum", features = ["ws", "headers"] }
tokio = { version = "1.0", features = ["full"] }
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
tower-http = { version = "0.2.0", features = ["fs", "trace"] }
tower-http = { version = "0.3.0", features = ["fs", "trace"] }
headers = "0.3"

0 comments on commit 79f6cde

Please sign in to comment.