Co-authored-by: Michael Vines <mvines@gmail.com>
This commit is contained in:
@ -65,7 +65,7 @@ impl RpcRequestMiddleware {
|
||||
Self {
|
||||
ledger_path,
|
||||
snapshot_archive_path_regex: Regex::new(
|
||||
r"/snapshot-\d+-[[:alnum:]]+\.(tar|tar\.bz2|tar\.zst|tar\.gz)$",
|
||||
r"^/snapshot-\d+-[[:alnum:]]+\.(tar|tar\.bz2|tar\.zst|tar\.gz)$",
|
||||
)
|
||||
.unwrap(),
|
||||
snapshot_config,
|
||||
@ -579,6 +579,9 @@ mod tests {
|
||||
assert!(rrm_with_snapshot_config.is_file_get_path(
|
||||
"/snapshot-100-AvFf9oS8A8U78HdjT9YG2sTTThLHJZmhaMn2g8vkWYnr.tar.zst"
|
||||
));
|
||||
assert!(!rrm_with_snapshot_config.is_file_get_path(
|
||||
"../snapshot-100-AvFf9oS8A8U78HdjT9YG2sTTThLHJZmhaMn2g8vkWYnr.tar.zst"
|
||||
));
|
||||
assert!(rrm_with_snapshot_config
|
||||
.is_file_get_path("/snapshot-100-AvFf9oS8A8U78HdjT9YG2sTTThLHJZmhaMn2g8vkWYnr.tar.gz"));
|
||||
assert!(rrm_with_snapshot_config
|
||||
|
Reference in New Issue
Block a user