Skip to content

Commit

Permalink
Mark HTTP body with serde_bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
arendjr committed Sep 25, 2024
1 parent a3a07c1 commit e304f04
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crux_http/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ futures-util = "0.3"
http-types = { package = "http-types-red-badger-temporary-fork", version = "2.12.0", default-features = false }
pin-project-lite = "0.2.14"
serde = { workspace = true, features = ["derive"] }
serde_bytes = "0.11"
serde_json = "1.0.128"
thiserror = "1.0.63"
url = "2.5.2"
Expand Down
2 changes: 2 additions & 0 deletions crux_http/src/protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ pub struct HttpRequest {
pub url: String,
#[builder(setter(custom))]
pub headers: Vec<HttpHeader>,
#[serde(with = "serde_bytes")]
pub body: Vec<u8>,
}

Expand Down Expand Up @@ -107,6 +108,7 @@ pub struct HttpResponse {
pub status: u16, // FIXME this probably should be a giant enum instead.
#[builder(setter(custom))]
pub headers: Vec<HttpHeader>,
#[serde(with = "serde_bytes")]
pub body: Vec<u8>,
}

Expand Down

0 comments on commit e304f04

Please sign in to comment.