From 1e682e7a594b6a9d7557012f93f060db597c1a33 Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Wed, 24 Aug 2022 18:07:13 +0100 Subject: [PATCH] update to prost 0.11 (#279) * updated to prost 0.11 and added application/x-protobuf * updated derive-more, prost, futures-util versions * updated Changelog and a small fix in Cargo.toml * cargo fmt * bumped version to 0.8.1 * removed version bump * add back intentional patch versions Co-authored-by: Ahmed Masud --- actix-protobuf/CHANGES.md | 2 ++ actix-protobuf/Cargo.toml | 4 ++-- actix-protobuf/src/lib.rs | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/actix-protobuf/CHANGES.md b/actix-protobuf/CHANGES.md index 8b88dc423..789133f17 100644 --- a/actix-protobuf/CHANGES.md +++ b/actix-protobuf/CHANGES.md @@ -1,6 +1,8 @@ # Changes ## Unreleased - 2022-xx-xx +- Added `application/x-protobuf` as an acceptable header. +- Updated `prost` dependency to `0.11`. ## 0.8.0 - 2022-06-25 diff --git a/actix-protobuf/Cargo.toml b/actix-protobuf/Cargo.toml index 6a5d3a44a..b55796e7c 100644 --- a/actix-protobuf/Cargo.toml +++ b/actix-protobuf/Cargo.toml @@ -20,8 +20,8 @@ path = "src/lib.rs" actix-web = { version = "4", default_features = false } derive_more = "0.99.5" futures-util = { version = "0.3.7", default-features = false } -prost = { version = "0.10", default_features = false } +prost = { version = "0.11", default_features = false } [dev-dependencies] actix-web = { version = "4", default_features = false, features = ["macros"] } -prost = { version = "0.10", default_features = false, features = ["prost-derive"] } +prost = { version = "0.11", default_features = false, features = ["prost-derive"] } diff --git a/actix-protobuf/src/lib.rs b/actix-protobuf/src/lib.rs index 8f13f9c8f..f7a8bedcb 100644 --- a/actix-protobuf/src/lib.rs +++ b/actix-protobuf/src/lib.rs @@ -172,7 +172,9 @@ pub struct ProtoBufMessage { impl ProtoBufMessage { /// Create `ProtoBufMessage` for request. pub fn new(req: &HttpRequest, payload: &mut Payload) -> Self { - if req.content_type() != "application/protobuf" { + if req.content_type() != "application/protobuf" + && req.content_type() != "application/x-protobuf" + { return ProtoBufMessage { limit: 262_144, length: None,