fix httpclient using the wrong method default tip

Sat, 07 Mar 2026 23:35:16 +0100

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Sat, 07 Mar 2026 23:35:16 +0100
changeset 726
5ad3bda4aca1
parent 725
fcd92f022e93

fix httpclient using the wrong method

src/server/proxy/httpclient.c file | annotate | diff | comparison | revisions
src/server/safs/proxy.c file | annotate | diff | comparison | revisions
--- a/src/server/proxy/httpclient.c	Sat Mar 07 23:26:02 2026 +0100
+++ b/src/server/proxy/httpclient.c	Sat Mar 07 23:35:16 2026 +0100
@@ -275,10 +275,11 @@
         return 1;
     }
     
-    if(client->method) {
+    if(!client->method) {
         cxBufferPutString(&buf, "GET ");
     } else {
         cxBufferPutString(&buf, client->method);
+        cxBufferPut(&buf, ' ');
     }
     cxBufferPutString(&buf, client->uri ? client->uri : "/");
     cxBufferPutString(&buf, " HTTP/1.1\r\n");
--- a/src/server/safs/proxy.c	Sat Mar 07 23:26:02 2026 +0100
+++ b/src/server/safs/proxy.c	Sat Mar 07 23:35:16 2026 +0100
@@ -87,6 +87,9 @@
 
 static void proxy_unref(ProxyRequest *proxy) {
     if(--proxy->ref == 0) {
+        //const char *method = pblock_findkeyval(pb_key_method, proxy->rq->reqpb);
+        //const char *uri = pblock_findkeyval(pb_key_uri, proxy->rq->reqpb);
+        //log_ereport(LOG_INFORM, "reverse-proxy: %s %s finished", method, uri);
         http_client_free(proxy->client);
         free(proxy->read_buf);
         free(proxy);
@@ -316,6 +319,8 @@
     const char *uri = pblock_findkeyval(pb_key_uri, rq->reqpb);
     const char *query = pblock_findkeyval(pb_key_query, rq->reqpb);
     
+    //log_ereport(LOG_INFORM, "reverse-proxy: %s %s", method, uri);
+    
     char *host_header = pblock_findval("host-header", param);
     
     const char *location = pblock_findval("location", param);

mercurial