diff --git a/Cargo.toml b/Cargo.toml index 953c8cd..722ddbe 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,13 +22,13 @@ include = [ # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -scraper = { version = "0.16" } -reqwest = { version = "0.11", default-features = false, features = [ "cookies", "rustls-tls", "blocking" ] } -rustls = { version = "0.21" } -thiserror = { version = "1" } -lazy_static = { version = "1.4" } +scraper = { version = "0.22" } +reqwest = { version = "0.12", default-features = false, features = [ "cookies", "rustls-tls", "blocking" ] } +rustls = { version = "0.23" } +thiserror = { version = "2" } +lazy_static = { version = "1.5" } [dev-dependencies] -rstest = { version = "0.17" } +rstest = { version = "0.23" } tiny_http = { version = "0.12" } urlencoding = { version = "2.1" } diff --git a/src/form.rs b/src/form.rs index 4ed02f0..4d00fe5 100644 --- a/src/form.rs +++ b/src/form.rs @@ -187,13 +187,13 @@ impl Form { if !self.action.starts_with('/') { // action relative to the current path; so add current path if self.page_url.path().ends_with('/') { - // discard trailing slash of current path - url.push_str(&self.page_url.path()[..self.page_url.path().len() - 1]); + url.push_str(&self.page_url.path()); } else { - // discard last page / file + // discard last page / file segment let mut path_parts: Vec<&str> = self.page_url.path().split('/').collect(); path_parts.pop(); url.push_str(&path_parts.join("/")); + url.push('/'); } }