v0.25.1
This commit is contained in:
1 parent
87e571c170
commit
fa7abc9e53
308 files changed
+49746
-50237
No files matched your search
@@ -0,0 +1,23 @@
|
||||
use http::Version;
|
||||
use std::net::IpAddr;
|
||||
|
||||
pub struct RequestContext {
|
||||
pub client_ip: IpAddr,
|
||||
pub client_port: Option<u16>,
|
||||
pub server_name: String,
|
||||
pub server_port: u16,
|
||||
pub tls: bool,
|
||||
pub version: Version,
|
||||
}
|
||||
|
||||
|
||||
pub(super) fn server_protocol(version: http::Version) -> &'static str {
|
||||
match version {
|
||||
http::Version::HTTP_09 => "HTTP/0.9",
|
||||
http::Version::HTTP_10 => "HTTP/1.0",
|
||||
http::Version::HTTP_11 => "HTTP/1.1",
|
||||
http::Version::HTTP_2 => "HTTP/2.0",
|
||||
http::Version::HTTP_3 => "HTTP/3.0",
|
||||
_ => "HTTP/1.1",
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user