Merge branch 'develop' into feature/unit_tests
This commit is contained in:
commit
b01eb69e95
1 changed files with 9 additions and 9 deletions
|
|
@ -64,13 +64,13 @@ impl TryFrom<String> for FileID {
|
|||
|
||||
fn try_from(value: String) -> crate::Result<Self> {
|
||||
/// 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<fid>[^/]+)` – 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<fid>[^/]+)` - capture FID (one or more non-slash chars)
|
||||
/// - `$` - end of string
|
||||
static UPLOAD_URL_RE: LazyLock<Regex> = LazyLock::new(|| {
|
||||
trace!("compiling UPLOAD_URL_RE");
|
||||
|
||||
|
|
@ -92,7 +92,7 @@ impl TryFrom<String> for FileID {
|
|||
Ok(result)
|
||||
} else {
|
||||
Err(crate::Error::mismatch(
|
||||
"<proto>://<base>/api/v2/alias/upload/<share>/files/tus/<file>",
|
||||
"<proto>://<host>/api/v2/alias/upload/<share>/files/tus/<file>",
|
||||
value,
|
||||
))
|
||||
}
|
||||
|
|
@ -188,7 +188,7 @@ mod tests {
|
|||
match err {
|
||||
crate::Error::Mismatch { expected, actual } => {
|
||||
assert_eq!(
|
||||
expected, "<proto>://<base>/api/v2/alias/upload/<share>/files/tus/<file>",
|
||||
expected, "<proto>://<host>/api/v2/alias/upload/<share>/files/tus/<file>",
|
||||
"Error should output expected format"
|
||||
);
|
||||
assert_eq!(actual, bad, "Error should echo back the input");
|
||||
|
|
|
|||
Loading…
Reference in a new issue