From 00ba8d55492284581695d824648590715a8bd386 Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Wed, 6 Jan 2021 18:58:24 +0000 Subject: [PATCH] add http3 variant to protocol enum --- actix-http/CHANGES.md | 3 +++ actix-http/src/lib.rs | 4 +++- actix-http/src/service.rs | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/actix-http/CHANGES.md b/actix-http/CHANGES.md index eadbf6f46..6daed67a0 100644 --- a/actix-http/CHANGES.md +++ b/actix-http/CHANGES.md @@ -1,6 +1,9 @@ # Changes ## Unreleased - 2021-xx-xx +### Added +* Add `Http3` to `Protocol` enum for future compatibility and also mark `#[non_exhaustive]`. + ### Changed * Update `actix-*` dependencies to tokio `1.0` based versions. [#1813] * Bumped `rand` to `0.8`. diff --git a/actix-http/src/lib.rs b/actix-http/src/lib.rs index 3879bae81..e17b7de0a 100644 --- a/actix-http/src/lib.rs +++ b/actix-http/src/lib.rs @@ -72,11 +72,13 @@ pub mod http { pub use crate::message::ConnectionType; } -/// HTTP protocol +/// A major HTTP protocol version. #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)] +#[non_exhaustive] pub enum Protocol { Http1, Http2, + Http3, } type ConnectCallback = dyn Fn(&IO, &mut Extensions); diff --git a/actix-http/src/service.rs b/actix-http/src/service.rs index e137ab6fa..392a1426f 100644 --- a/actix-http/src/service.rs +++ b/actix-http/src/service.rs @@ -580,6 +580,8 @@ where peer_addr, )), }, + + proto => unimplemented!("Unsupported HTTP version: {:?}.", proto) } } }