Update papplClientGetForm to parse GET form data from the options (Issue
@@ -24,7 +24,7 @@ static char *get_cookie(pappl_client_t *client, const char *name, char *buffer,
//
-// 'papplClientGetForm()' - Get POST form data from the web client.
+// 'papplClientGetForm()' - Get GET/POST form data from the web client.
//
int // O - Number of form variables read
@@ -44,6 +44,29 @@ papplClientGetForm(
http_state_t initial_state; // Initial HTTP state
+ if (!client || !form)
+ {
+ if (form)
+ *form = NULL;
+
+ return (0);
+ }
+
+ if (client->operation == HTTP_STATE_GET)
+ {
+ // Copy form data from the request URI...
+ if (!client->options)
+ {
+ *form = NULL;
+ return (0);
+ }
+
+ strlcpy(body, client->options, sizeof(body));
+ body_size = strlen(body);
+ content_type = "application/x-www-form-urlencoded";
+ }
+ else
+ {
// Read up to 2MB of data from the client...
*form = NULL;
initial_state = httpGetState(client->http);
@@ -61,6 +84,7 @@ papplClientGetForm(
// Flush remaining data...
if (httpGetState(client->http) == initial_state)
httpFlush(client->http);
+ }
// Parse the data in memory...
bodyend = body + body_size;
