SoupRequestData was not returning the decoded version of data URLs when they
were not encoded in base64
https://bugzilla.gnome.org/show_bug.cgi?id=641022
end = comma;
if (end != start) {
end = comma;
if (end != start) {
- data->priv->content_type = g_strndup (start, end - start);
- if (!base64)
- soup_uri_decode (data->priv->content_type);
+ char *encoded_content_type = g_strndup (start, end - start);
+
+ if (base64)
+ data->priv->content_type = encoded_content_type;
+ else {
+ data->priv->content_type = soup_uri_decode (encoded_content_type);
+ g_free (encoded_content_type);
+ }
- soup_uri_decode (start);
- data->priv->content_length = strlen (start);
- buf = g_memdup (start, data->priv->content_length);
+ buf = (guchar *) soup_uri_decode (start);
+ data->priv->content_length = strlen ((const char *) buf);
}
g_memory_input_stream_add_data (G_MEMORY_INPUT_STREAM (memstream),
}
g_memory_input_stream_add_data (G_MEMORY_INPUT_STREAM (memstream),