Set GET as the default when method is not defined (fixes a crash)

This commit is contained in:
Pierre Pronchery 2009-03-06 11:49:10 +00:00
parent 02791496d4
commit fbf431efde

View File

@ -885,7 +885,7 @@ static void _on_submit(HtmlDocument * document, const gchar * url,
ghtml = g_object_get_data(G_OBJECT(document), "ghtml"); ghtml = g_object_get_data(G_OBJECT(document), "ghtml");
if((u = _ghtml_make_url(ghtml->html_base, url)) == NULL) if((u = _ghtml_make_url(ghtml->html_base, url)) == NULL)
return; /* FIXME report error */ return; /* FIXME report error */
if(strcasecmp(method, "GET") == 0) if(method == NULL || strcasecmp(method, "GET") == 0)
{ {
v = (encoding != NULL) ? g_strdup_printf("%s?%s", u, encoding) v = (encoding != NULL) ? g_strdup_printf("%s?%s", u, encoding)
: g_strdup(u); : g_strdup(u);