Skip to content

Commit

Permalink
Use serde_bytes for GsbHttpProxy Message and Response (#3339)
Browse files Browse the repository at this point in the history
  • Loading branch information
mwalkiewicz authored Oct 3, 2024
1 parent 5f8be31 commit 7f6a3ae
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 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 exe-unit/components/gsb-http-proxy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ log = { version = "0.4", features = [] }
rand = { workspace = true }
reqwest = { version = "0.11", features = ["json", "stream"] }
serde = { version = "1.0", features = ["derive"] }
serde_bytes = "0.11.3"
serde_derive = "1.0"
serde_json = "1.0"
thiserror = "1.0"
Expand Down
2 changes: 2 additions & 0 deletions exe-unit/components/gsb-http-proxy/src/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ use ya_service_bus::{RpcMessage, RpcStreamMessage};
pub struct GsbHttpCallMessage {
pub method: String,
pub path: String,
#[serde(with = "serde_bytes")]
pub body: Option<Vec<u8>>,
pub headers: HashMap<String, Vec<String>>,
}
Expand All @@ -28,6 +29,7 @@ impl RpcMessage for GsbHttpCallMessage {
pub struct GsbHttpCallStreamingMessage {
pub method: String,
pub path: String,
#[serde(with = "serde_bytes")]
pub body: Option<Vec<u8>>,
pub headers: HashMap<String, Vec<String>>,
}
Expand Down
1 change: 1 addition & 0 deletions exe-unit/components/gsb-http-proxy/src/response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ pub struct GsbHttpCallResponseHeader {

#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default)]
pub struct GsbHttpCallResponseBody {
#[serde(with = "serde_bytes")]
pub msg_bytes: Vec<u8>,
}

Expand Down

0 comments on commit 7f6a3ae

Please sign in to comment.