aboutsummaryrefslogtreecommitdiff
path: root/src/microhttpd/daemon.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/microhttpd/daemon.c')
-rw-r--r--src/microhttpd/daemon.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index 8ba1baba..251e563e 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -45,6 +45,7 @@
45#include "mhd_compat.h" 45#include "mhd_compat.h"
46#include "mhd_send.h" 46#include "mhd_send.h"
47#include "mhd_align.h" 47#include "mhd_align.h"
48#include "mhd_str.h"
48 49
49#ifdef HAVE_SEARCH_H 50#ifdef HAVE_SEARCH_H
50#include <search.h> 51#include <search.h>
@@ -5672,7 +5673,7 @@ MHD_polling_thread (void *cls)
5672 5673
5673/** 5674/**
5674 * Process escape sequences ('%HH') Updates val in place; the 5675 * Process escape sequences ('%HH') Updates val in place; the
5675 * result should be UTF-8 encoded and cannot be larger than the input. 5676 * result cannot be larger than the input.
5676 * The result must also still be 0-terminated. 5677 * The result must also still be 0-terminated.
5677 * 5678 *
5678 * @param cls closure (use NULL) 5679 * @param cls closure (use NULL)
@@ -5686,10 +5687,23 @@ unescape_wrapper (void *cls,
5686 struct MHD_Connection *connection, 5687 struct MHD_Connection *connection,
5687 char *val) 5688 char *val)
5688{ 5689{
5690 bool broken;
5691 size_t res;
5689 (void) cls; /* Mute compiler warning. */ 5692 (void) cls; /* Mute compiler warning. */
5690 5693
5691 (void) connection; /* Mute compiler warning. */ 5694 /* TODO: add individual parameter */
5692 return MHD_http_unescape (val); 5695 if (1 <= connection->daemon->strict_for_client)
5696 return MHD_str_pct_decode_in_place_strict_ (val);
5697
5698 res = MHD_str_pct_decode_in_place_lenient_ (val, &broken);
5699#ifdef HAVE_MESSAGES
5700 if (broken)
5701 {
5702 MHD_DLOG (connection->daemon,
5703 _ ("The URL encoding is broken.\n"));
5704 }
5705#endif /* HAVE_MESSAGES */
5706 return res;
5693} 5707}
5694 5708
5695 5709