[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] 07/15: Do not send "100 Continue" if request does not ha
From: |
gnunet |
Subject: |
[libmicrohttpd] 07/15: Do not send "100 Continue" if request does not have a body |
Date: |
Fri, 28 Oct 2022 11:21:56 +0200 |
This is an automated email from the git hooks/post-receive script.
karlson2k pushed a commit to branch master
in repository libmicrohttpd.
commit 692e8c56553a4ec0a432704816b8340711b68aed
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Fri Oct 21 09:53:05 2022 +0300
Do not send "100 Continue" if request does not have a body
---
src/microhttpd/connection.c | 32 +++++++++++++++++++++-----------
1 file changed, 21 insertions(+), 11 deletions(-)
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index 9589a2d8..885557b5 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -765,17 +765,27 @@ need_100_continue (struct MHD_Connection *connection)
{
const char *expect;
- return (MHD_IS_HTTP_VER_1_1_COMPAT (connection->rq.http_ver) &&
- (MHD_NO !=
- MHD_lookup_connection_value_n (connection,
- MHD_HEADER_KIND,
- MHD_HTTP_HEADER_EXPECT,
- MHD_STATICSTR_LEN_ (
- MHD_HTTP_HEADER_EXPECT),
- &expect,
- NULL)) &&
- (MHD_str_equal_caseless_ (expect,
- "100-continue")) );
+ if (! MHD_IS_HTTP_VER_1_1_COMPAT (connection->rq.http_ver))
+ return false;
+
+ if (0 == connection->rq.remaining_upload_size)
+ return false;
+
+ if (MHD_NO ==
+ MHD_lookup_connection_value_n (connection,
+ MHD_HEADER_KIND,
+ MHD_HTTP_HEADER_EXPECT,
+ MHD_STATICSTR_LEN_ ( \
+ MHD_HTTP_HEADER_EXPECT),
+ &expect,
+ NULL))
+ return false;
+
+ if (MHD_str_equal_caseless_ (expect,
+ "100-continue"))
+ return true;
+
+ return false;
}
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [libmicrohttpd] 11/15: testcurl: added test with Content-Length broken value in request, (continued)
- [libmicrohttpd] 11/15: testcurl: added test with Content-Length broken value in request, gnunet, 2022/10/28
- [libmicrohttpd] 08/15: Do not send "100 Continue" if part of the request body is already received, gnunet, 2022/10/28
- [libmicrohttpd] 01/15: Added ability to check for MHD debug builds at run-time, gnunet, 2022/10/28
- [libmicrohttpd] 02/15: Added check for hypothetical too large accepted sockets addresses, gnunet, 2022/10/28
- [libmicrohttpd] 13/15: test_head: check libcurl for timeout value, gnunet, 2022/10/28
- [libmicrohttpd] 06/15: Renamed one more connection state for clarity, gnunet, 2022/10/28
- [libmicrohttpd] 05/15: Renamed one state in MHD_ConnectionEventLoopInfo for clarity, gnunet, 2022/10/28
- [libmicrohttpd] 10/15: connection.c: fixed handling of various errors automatically detected by MHD code, gnunet, 2022/10/28
- [libmicrohttpd] 09/15: Reworked partial processing of the upload, gnunet, 2022/10/28
- [libmicrohttpd] 15/15: microhttpd.h: doxy improvements, gnunet, 2022/10/28
- [libmicrohttpd] 07/15: Do not send "100 Continue" if request does not have a body,
gnunet <=