diff --git a/core/http/src/uri/segments.rs b/core/http/src/uri/segments.rs index 526c8173..f42596eb 100644 --- a/core/http/src/uri/segments.rs +++ b/core/http/src/uri/segments.rs @@ -215,12 +215,10 @@ impl<'a> Segments<'a, Path> { return Err(PathError::BadEnd('<')) } else if segment.contains('/') { return Err(PathError::BadChar('/')) - } else if cfg!(windows) { - if segment.contains('\\') { - return Err(PathError::BadChar('\\')) - } else if segment.contains(':') { - return Err(PathError::BadChar(':')) - } + } else if cfg!(windows) && segment.contains('\\') { + return Err(PathError::BadChar('\\')) + } else if cfg!(windows) && segment.contains(':') { + return Err(PathError::BadChar(':')) } else { buf.push(&*segment) }