diff --git a/src/sharry/ids.rs b/src/sharry/ids.rs index 57a5cd2..4e0a1c4 100644 --- a/src/sharry/ids.rs +++ b/src/sharry/ids.rs @@ -54,13 +54,13 @@ impl TryFrom for FileID { fn try_from(value: String) -> crate::Result { /// Pattern breakdown: - /// - `^([^:/?#]+)://` – scheme (anything but `:/?#`) + `"://"` - /// - `([^/?#]+)` – authority/host (anything but `/?#`) - /// - `/api/v2/alias/upload/` – literal path segment - /// - `([^/]+)` – capture SID (one or more non-slash chars) - /// - `/files/tus/` – literal path segment - /// - `(?P[^/]+)` – capture FID (one or more non-slash chars) - /// - `$` – end of string + /// - `^([^:/?#]+)://` - scheme (anything but `:/?#`) + `"://"` + /// - `([^/?#]+)` - authority/host (anything but `/?#`) + /// - `/api/v2/alias/upload/` - literal path segment + /// - `([^/]+)` - capture SID (one or more non-slash chars) + /// - `/files/tus/` - literal path segment + /// - `(?P[^/]+)` - capture FID (one or more non-slash chars) + /// - `$` - end of string static UPLOAD_URL_RE: LazyLock = LazyLock::new(|| { trace!("compiling UPLOAD_URL_RE"); @@ -82,7 +82,7 @@ impl TryFrom for FileID { Ok(result) } else { Err(crate::Error::mismatch( - ":///api/v2/alias/upload//files/tus/", + ":///api/v2/alias/upload//files/tus/", value, )) } @@ -143,7 +143,7 @@ mod tests { match err { crate::Error::Mismatch { expected, actual } => { assert_eq!( - expected, ":///api/v2/alias/upload//files/tus/", + expected, ":///api/v2/alias/upload//files/tus/", "Error should output expected format" ); assert_eq!(actual, bad.to_string(), "Error should echo back the input");