gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libmicrohttpd] 02/02: Added error response for wrong 'Content-Length' v


From: gnunet
Subject: [libmicrohttpd] 02/02: Added error response for wrong 'Content-Length' values
Date: Sun, 17 Oct 2021 14:14:30 +0200

This is an automated email from the git hooks/post-receive script.

karlson2k pushed a commit to branch master
in repository libmicrohttpd.

commit 746dae6ae094664c6ed0fa4bf5c98db7c758e8bc
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Sun Oct 17 15:14:17 2021 +0300

    Added error response for wrong 'Content-Length' values
---
 src/microhttpd/connection.c | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index dee41218..eb161ce7 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -114,6 +114,18 @@
 #define REQUEST_CHUNKED_MALFORMED ""
 #endif
 
+/**
+ * Response text used when the request HTTP chunked encoding is
+ * malformed.
+ */
+#ifdef HAVE_MESSAGES
+#define REQUEST_CONTENTLENGTH_MALFORMED \
+  "<html><head><title>Request malformed</title></head>" \
+  "<body>Your HTTP request has wrong value for <b>Content-Length</b> 
header.</body></html>"
+#else
+#define REQUEST_CHUNKED_MALFORMED ""
+#endif
+
 /**
  * Response text used when there is an internal server error.
  *
@@ -3505,8 +3517,9 @@ parse_connection_headers (struct MHD_Connection 
*connection)
                   _ (
                     "Failed to parse `Content-Length' header. Closing 
connection.\n"));
 #endif
-        CONNECTION_CLOSE_ERROR (connection,
-                                NULL);
+        transmit_error_response_static (connection,
+                                        MHD_HTTP_BAD_REQUEST,
+                                        REQUEST_CONTENTLENGTH_MALFORMED);
         return;
       }
     }

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]