From 821f22c244e2c70455ec048f9da368d4bcf41004 Mon Sep 17 00:00:00 2001 From: Lorenz Barnkow <13865903+lbarnkow@users.noreply.github.com> Date: Tue, 31 Dec 2024 17:46:34 +0100 Subject: [PATCH 1/2] fix url construction for form submission --- src/form.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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('/'); } } From 20efc6ece7d2ad87a3469b0b3e8758c5413d8499 Mon Sep 17 00:00:00 2001 From: Lorenz Barnkow <13865903+lbarnkow@users.noreply.github.com> Date: Tue, 31 Dec 2024 17:57:31 +0100 Subject: [PATCH 2/2] update dependencies --- Cargo.toml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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" }