Skip to content

Commit

Permalink
Add FileStream response to axum-extra (#3047)
Browse files Browse the repository at this point in the history
  • Loading branch information
YanHeDoki authored Dec 4, 2024
1 parent 99c07e4 commit 7c871e9
Show file tree
Hide file tree
Showing 5 changed files with 599 additions and 0 deletions.
2 changes: 2 additions & 0 deletions axum-extra/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@ and this project adheres to [Semantic Versioning].
- **added:** Add `json!` for easy construction of JSON responses ([#2962])
- **added:** Add `InternalServerError` response for logging an internal error
and returning HTTP 500 in a convenient way. ([#3010])
- **added:** Add `FileStream` for easy construction of file stream responses ([#3047])

[#2242]: https://github.com/tokio-rs/axum/pull/2242
[#3058]: https://github.com/tokio-rs/axum/pull/3058
[#2961]: https://github.com/tokio-rs/axum/pull/2961
[#2962]: https://github.com/tokio-rs/axum/pull/2962
[#3010]: https://github.com/tokio-rs/axum/pull/3010
[#3047]: https://github.com/tokio-rs/axum/pull/3047

# 0.10.0

Expand Down
3 changes: 3 additions & 0 deletions axum-extra/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ version = "0.10.0-alpha.1"
default = ["tracing"]

async-read-body = ["dep:tokio-util", "tokio-util?/io", "dep:tokio"]
file-stream = ["dep:tokio-util", "tokio-util?/io", "dep:tokio", "tokio?/fs", "tokio?/io-util"]
attachment = ["dep:tracing"]
error-response = ["dep:tracing", "tracing/std"]
cookie = ["dep:cookie"]
Expand Down Expand Up @@ -56,6 +57,7 @@ tower-layer = "0.3"
tower-service = "0.3"

# optional dependencies
async-stream = { version = "0.3", optional = true }
axum-macros = { path = "../axum-macros", version = "0.5.0-alpha.1", optional = true }
cookie = { package = "cookie", version = "0.18.0", features = ["percent-encode"], optional = true }
fastrand = { version = "2.1.0", optional = true }
Expand Down Expand Up @@ -107,6 +109,7 @@ allowed = [
"prost",
"serde",
"tokio",
"tokio_util",
"tower_layer",
"tower_service",
]
1 change: 1 addition & 0 deletions axum-extra/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
//! `tracing` | Log rejections from built-in extractors | Yes
//! `typed-routing` | Enables the [`TypedPath`](crate::routing::TypedPath) routing utilities | No
//! `typed-header` | Enables the [`TypedHeader`] extractor and response | No
//! `FileStream` | Enables the [`FileStream`](crate::response::FileStream) response | No
//!
//! [`axum`]: https://crates.io/crates/axum
Expand Down
Loading

0 comments on commit 7c871e9

Please sign in to comment.