mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-11 07:36:53 +00:00
This commit is contained in:
@@ -30,8 +30,8 @@ pub const X_REAL_IP: &str = "x-real-ip";
|
||||
/// e.g. Forwarded: for=192.0.2.60;proto=https;by=203.0.113.43
|
||||
const FORWARDED: &str = "forwarded";
|
||||
|
||||
static FOR_REGEX: LazyLock<Regex> = LazyLock::new(|| Regex::new(r"(?i)(?:for=)([^(;|,| )]+)(.*)").unwrap());
|
||||
static PROTO_REGEX: LazyLock<Regex> = LazyLock::new(|| Regex::new(r"(?i)^(;|,| )+(?:proto=)(https|http)").unwrap());
|
||||
static FOR_REGEX: LazyLock<Regex> = LazyLock::new(|| Regex::new(r"(?i)(?:for=)([^(;|,| )]+)(.*)").expect("operation should succeed"));
|
||||
static PROTO_REGEX: LazyLock<Regex> = LazyLock::new(|| Regex::new(r"(?i)^(;|,| )+(?:proto=)(https|http)").expect("operation should succeed"));
|
||||
|
||||
/// Used to disable all processing of the X-Forwarded-For header in source IP discovery.
|
||||
///
|
||||
|
||||
@@ -84,7 +84,7 @@ impl Stream for RetryTimer {
|
||||
self.timer = Some(timer);
|
||||
}
|
||||
|
||||
let mut timer = self.timer.as_mut().unwrap();
|
||||
let mut timer = self.timer.as_mut().expect("operation should succeed");
|
||||
match Pin::new(&mut timer).poll_tick(cx) {
|
||||
Poll::Ready(_) => {
|
||||
self.rem -= 1;
|
||||
@@ -151,7 +151,7 @@ pub fn is_request_error_retryable(_err: std::io::Error) -> bool {
|
||||
}
|
||||
let uerr = err.(*url.Error);
|
||||
if uerr.is_ok() {
|
||||
let e = uerr.unwrap();
|
||||
let e = uerr.expect("operation should succeed");
|
||||
return match e.type {
|
||||
x509.UnknownAuthorityError => {
|
||||
false
|
||||
|
||||
Reference in New Issue
Block a user