src/server/proxy/httpclient.c

changeset 668
0a7d1e9ca6b8
parent 666
c99e0b352e36
--- a/src/server/proxy/httpclient.c	Thu Feb 12 11:20:43 2026 +0100
+++ b/src/server/proxy/httpclient.c	Thu Feb 12 16:02:09 2026 +0100
@@ -122,7 +122,27 @@
         return 1;
     }
     
+    if(client->method) {
+        cxBufferPutString(&buf, "GET ");
+    } else {
+        cxBufferPutString(&buf, client->method);
+    }
+    cxBufferPutString(&buf, client->uri ? client->uri : "/");
+    cxBufferPutString(&buf, " HTTP/1.1\r\n");
     
+    HeaderArray *hdr = client->request_headers;
+    while(hdr) {
+        for(int i=0;i<hdr->len;i++) {
+            cxBufferPutString(&buf, hdr->headers[i].name);
+            cxBufferPutString(&buf, ": ");
+            cxBufferPutString(&buf, hdr->headers[i].value);
+            cxBufferPutString(&buf, "\r\n");
+        }
+        hdr = hdr->next;
+    }
+    cxBufferPutString(&buf, "\r\n");
+    client->req_buffer = buf.space;
+    client->req_buffer_len = buf.size;
     
     return 0;
 }

mercurial