From 0322ec5647d608640ee44f349ef5bcf394ad818f Mon Sep 17 00:00:00 2001
From: Sergey Lyubka <valenok@gmail.com>
Date: Wed, 22 Oct 2014 12:14:21 +0100
Subject: [PATCH] Include query_string when proxying requests

---
 mongoose.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/mongoose.c b/mongoose.c
index 5fcbd55b8..84c2d6094 100644
--- a/mongoose.c
+++ b/mongoose.c
@@ -4264,7 +4264,9 @@ static void handle_ssi_request(struct connection *conn, const char *path) {
 static void proxy_request(struct ns_connection *pc, struct mg_connection *c) {
   int i, sent_close_header = 0;
 
-  ns_printf(pc, "%s %s HTTP/%s\r\n", c->request_method, c->uri,
+  ns_printf(pc, "%s %s%s%s HTTP/%s\r\n", c->request_method, c->uri,
+            c->query_string ? "?" : "",
+            c->query_string ? c->query_string : "",
             c->http_version);
   for (i = 0; i < c->num_headers; i++) {
     if (mg_strcasecmp(c->http_headers[i].name, "Connection") == 0) {
-- 
GitLab