mirror of
https://github.com/rustfs/rustfs.git
synced 2026-07-26 08:18:18 +00:00
feat(scanner): expose usage freshness status (#3577)
* feat(scanner): expose usage freshness status * fix(scanner): reset dirty usage cycle state --------- Co-authored-by: Henry Guo <marshawcoco@users.noreply.github.com>
This commit is contained in:
@@ -70,8 +70,23 @@ fn materialize_object(base: String, extra: &str, flags: &[String]) -> String {
|
||||
|
||||
fn has_dot_segments(path: &str) -> bool {
|
||||
path.split(['/', '\\']).any(|segment| {
|
||||
let trimmed = segment.trim();
|
||||
trimmed == "." || trimmed == ".."
|
||||
let mut bytes = segment.as_bytes();
|
||||
|
||||
// Match ecstore's path-component check. `str::trim()` also trims
|
||||
// Unicode whitespace such as vertical tab, which would reject object
|
||||
// keys that the production validator accepts as ordinary path bytes.
|
||||
while let Some((first, rest)) = bytes.split_first()
|
||||
&& first.is_ascii_whitespace()
|
||||
{
|
||||
bytes = rest;
|
||||
}
|
||||
while let Some((last, rest)) = bytes.split_last()
|
||||
&& last.is_ascii_whitespace()
|
||||
{
|
||||
bytes = rest;
|
||||
}
|
||||
|
||||
bytes == b"." || bytes == b".."
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user