mirror of https://github.com/rwf2/Rocket.git
parent
1b37d571c2
commit
ccf0b802bc
|
@ -172,7 +172,7 @@ impl<'a> Segments<'a, Path> {
|
||||||
/// * Decoded segment starts with any of: `*`
|
/// * Decoded segment starts with any of: `*`
|
||||||
/// * Decoded segment ends with any of: `:`, `>`, `<`
|
/// * Decoded segment ends with any of: `:`, `>`, `<`
|
||||||
/// * Decoded segment contains any of: `/`
|
/// * Decoded segment contains any of: `/`
|
||||||
/// * On Windows, decoded segment contains any of: `\`
|
/// * On Windows, decoded segment contains any of: `\`, `:`
|
||||||
/// * Percent-encoding results in invalid UTF-8.
|
/// * Percent-encoding results in invalid UTF-8.
|
||||||
///
|
///
|
||||||
/// Additionally, if `allow_dotfiles` is `false`, an `Err` is returned if
|
/// Additionally, if `allow_dotfiles` is `false`, an `Err` is returned if
|
||||||
|
@ -215,8 +215,12 @@ impl<'a> Segments<'a, Path> {
|
||||||
return Err(PathError::BadEnd('<'))
|
return Err(PathError::BadEnd('<'))
|
||||||
} else if segment.contains('/') {
|
} else if segment.contains('/') {
|
||||||
return Err(PathError::BadChar('/'))
|
return Err(PathError::BadChar('/'))
|
||||||
} else if cfg!(windows) && segment.contains('\\') {
|
} else if cfg!(windows) {
|
||||||
|
if segment.contains('\\') {
|
||||||
return Err(PathError::BadChar('\\'))
|
return Err(PathError::BadChar('\\'))
|
||||||
|
} else if segment.contains(':') {
|
||||||
|
return Err(PathError::BadChar(':'))
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
buf.push(&*segment)
|
buf.push(&*segment)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue