challenger

OAuth 2.0-based authentication service that validates user can receive messages at a certain address
Log | Files | Refs | Submodules | README | LICENSE

commit dd72e4d0b0d108c7d90e1f22f1d2e2ef0c0271fe
parent 9ee7523913bb07935c8421388acf8bd024f158aa
Author: Christian Grothoff <christian@grothoff.org>
Date:   Tue, 15 Apr 2025 15:52:18 +0200

keep /setup working if there is no body

Diffstat:
Msrc/challenger/challenger-httpd_setup.c | 11++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/challenger/challenger-httpd_setup.c b/src/challenger/challenger-httpd_setup.c @@ -80,6 +80,7 @@ CH_handler_setup (struct CH_HandlerContext *hc, struct SetupContext *sc = hc->ctx; unsigned long long client_id; const char *client_secret; + const char *cl; if (NULL == sc) { @@ -90,7 +91,15 @@ CH_handler_setup (struct CH_HandlerContext *hc, hc->ctx = sc; return MHD_YES; } - if (NULL == sc->root) + cl = MHD_lookup_connection_value (hc->connection, + MHD_HEADER_KIND, + MHD_HTTP_HEADER_CONTENT_LENGTH); + /* If we have a body (Content-length set and not zero) and we + are not yet done parsing it, try to parse it! */ + if ( (NULL == sc->root) && + (NULL != cl) && + (0 != strcmp ("0", + cl)) ) { /* parse byte stream upload into JSON */ enum GNUNET_GenericReturnValue res;