all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: Lukas Wagner <l.wagner@proxmox.com>
To: pve-devel@lists.proxmox.com, pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox] http: use request method from provided param instead of unconditional POST
Date: Mon,  4 Aug 2025 10:06:04 +0200	[thread overview]
Message-ID: <20250804080604.118202-1-l.wagner@proxmox.com> (raw)

This fixes the "bad uri: POST is missing scheme" error that appeared
when using the webhook notification targets.

Fixes: a0dc071ee14 ("http: update to ureq3")
Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
---
 proxmox-http/src/client/sync.rs | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/proxmox-http/src/client/sync.rs b/proxmox-http/src/client/sync.rs
index b809ee38..fe87a0cf 100644
--- a/proxmox-http/src/client/sync.rs
+++ b/proxmox-http/src/client/sync.rs
@@ -127,7 +127,9 @@ impl HttpClient<String, String> for Client {
         let (parts, body) = request.into_parts();
 
         let agent = self.agent()?;
-        let mut req = http::Request::post(parts.method.as_str());
+        let mut req = http::Request::builder()
+            .method(parts.method.as_str())
+            .uri(parts.uri);
 
         for header in parts.headers.keys() {
             for value in parts.headers.get_all(header) {
@@ -182,7 +184,9 @@ impl HttpClient<&[u8], Vec<u8>> for Client {
         let (parts, body) = request.into_parts();
 
         let agent = self.agent()?;
-        let mut req = http::Request::post(parts.method.as_str());
+        let mut req = http::Request::builder()
+            .method(parts.method.as_str())
+            .uri(parts.uri);
 
         for header in parts.headers.keys() {
             for value in parts.headers.get_all(header) {
@@ -240,7 +244,9 @@ impl HttpClient<Box<dyn Read>, Box<dyn Read>> for Client {
         let (parts, body) = request.into_parts();
 
         let agent = self.agent()?;
-        let mut req = http::Request::post(parts.method.as_str());
+        let mut req = http::Request::builder()
+            .method(parts.method.as_str())
+            .uri(parts.uri);
 
         for header in parts.headers.keys() {
             for value in parts.headers.get_all(header) {
-- 
2.47.2



_______________________________________________
pbs-devel mailing list
pbs-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel


WARNING: multiple messages have this Message-ID
From: Lukas Wagner <l.wagner@proxmox.com>
To: pve-devel@lists.proxmox.com, pbs-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH proxmox] http: use request method from provided param instead of unconditional POST
Date: Mon,  4 Aug 2025 10:06:04 +0200	[thread overview]
Message-ID: <20250804080604.118202-1-l.wagner@proxmox.com> (raw)

This fixes the "bad uri: POST is missing scheme" error that appeared
when using the webhook notification targets.

Fixes: a0dc071ee14 ("http: update to ureq3")
Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
---
 proxmox-http/src/client/sync.rs | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/proxmox-http/src/client/sync.rs b/proxmox-http/src/client/sync.rs
index b809ee38..fe87a0cf 100644
--- a/proxmox-http/src/client/sync.rs
+++ b/proxmox-http/src/client/sync.rs
@@ -127,7 +127,9 @@ impl HttpClient<String, String> for Client {
         let (parts, body) = request.into_parts();
 
         let agent = self.agent()?;
-        let mut req = http::Request::post(parts.method.as_str());
+        let mut req = http::Request::builder()
+            .method(parts.method.as_str())
+            .uri(parts.uri);
 
         for header in parts.headers.keys() {
             for value in parts.headers.get_all(header) {
@@ -182,7 +184,9 @@ impl HttpClient<&[u8], Vec<u8>> for Client {
         let (parts, body) = request.into_parts();
 
         let agent = self.agent()?;
-        let mut req = http::Request::post(parts.method.as_str());
+        let mut req = http::Request::builder()
+            .method(parts.method.as_str())
+            .uri(parts.uri);
 
         for header in parts.headers.keys() {
             for value in parts.headers.get_all(header) {
@@ -240,7 +244,9 @@ impl HttpClient<Box<dyn Read>, Box<dyn Read>> for Client {
         let (parts, body) = request.into_parts();
 
         let agent = self.agent()?;
-        let mut req = http::Request::post(parts.method.as_str());
+        let mut req = http::Request::builder()
+            .method(parts.method.as_str())
+            .uri(parts.uri);
 
         for header in parts.headers.keys() {
             for value in parts.headers.get_all(header) {
-- 
2.47.2



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


             reply	other threads:[~2025-08-04  8:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-04  8:06 Lukas Wagner [this message]
2025-08-04  8:06 ` [pve-devel] " Lukas Wagner
2025-08-04  9:29 ` [pbs-devel] " Lukas Wagner
2025-08-04  9:29   ` Lukas Wagner
2025-08-05  7:59 ` [pbs-devel] applied: " Lukas Wagner
2025-08-05  7:59   ` [pve-devel] " Lukas Wagner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250804080604.118202-1-l.wagner@proxmox.com \
    --to=l.wagner@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal