|
|
@@ -148,6 +148,21 @@ MHD_get_connection_values (struct MHD_Connection *connection,
|
|
|
}
|
|
|
|
|
|
|
|
|
+/**
|
|
|
+ * Convert all occurences of '+' to ' '.
|
|
|
+ *
|
|
|
+ * @param arg string that is modified
|
|
|
+ */
|
|
|
+static void
|
|
|
+escape_plus (char *arg)
|
|
|
+{
|
|
|
+ char *p;
|
|
|
+
|
|
|
+ for (p=strchr (arg, '+'); NULL != p; p = strchr (p + 1, '+'))
|
|
|
+ *p = ' ';
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* This function can be used to add an entry to the HTTP headers of a
|
|
|
* connection (so that the #MHD_get_connection_values function will
|
|
|
@@ -1175,6 +1190,7 @@ parse_arguments (enum MHD_ValueKind kind,
|
|
|
if (NULL == equals)
|
|
|
{
|
|
|
/* got 'foo', add key 'foo' with NULL for value */
|
|
|
+ escape_plus (args);
|
|
|
connection->daemon->unescape_callback (connection->daemon->unescape_callback_cls,
|
|
|
connection,
|
|
|
args);
|
|
|
@@ -1186,9 +1202,11 @@ parse_arguments (enum MHD_ValueKind kind,
|
|
|
/* got 'foo=bar' */
|
|
|
equals[0] = '\0';
|
|
|
equals++;
|
|
|
+ escape_plus (args);
|
|
|
connection->daemon->unescape_callback (connection->daemon->unescape_callback_cls,
|
|
|
connection,
|
|
|
args);
|
|
|
+ escape_plus (equals);
|
|
|
connection->daemon->unescape_callback (connection->daemon->unescape_callback_cls,
|
|
|
connection,
|
|
|
equals);
|
|
|
@@ -1201,6 +1219,7 @@ parse_arguments (enum MHD_ValueKind kind,
|
|
|
(equals >= amper) )
|
|
|
{
|
|
|
/* got 'foo&bar' or 'foo&bar=val', add key 'foo' with NULL for value */
|
|
|
+ escape_plus (args);
|
|
|
connection->daemon->unescape_callback (connection->daemon->unescape_callback_cls,
|
|
|
connection,
|
|
|
args);
|
|
|
@@ -1219,9 +1238,11 @@ parse_arguments (enum MHD_ValueKind kind,
|
|
|
so we got regular 'foo=value&bar...'-kind of argument */
|
|
|
equals[0] = '\0';
|
|
|
equals++;
|
|
|
+ escape_plus (args);
|
|
|
connection->daemon->unescape_callback (connection->daemon->unescape_callback_cls,
|
|
|
connection,
|
|
|
args);
|
|
|
+ escape_plus (equals);
|
|
|
connection->daemon->unescape_callback (connection->daemon->unescape_callback_cls,
|
|
|
connection,
|
|
|
equals);
|
|
|
@@ -1369,11 +1390,9 @@ parse_initial_message_line (struct MHD_Connection *connection,
|
|
|
args++;
|
|
|
parse_arguments (MHD_GET_ARGUMENT_KIND, connection, args);
|
|
|
}
|
|
|
-#if 0
|
|
|
connection->daemon->unescape_callback (connection->daemon->unescape_callback_cls,
|
|
|
connection,
|
|
|
uri);
|
|
|
-#endif
|
|
|
connection->url = uri;
|
|
|
if (NULL == http_version)
|
|
|
connection->version = "";
|