Modify decideresource() and favicon handling

Return as soon as the request has been processed.
No need to modify the favicon uri, just ignore it.
This commit is contained in:
Quentin Rameau 2015-11-22 15:19:10 +01:00
parent b70a966aa6
commit c3a827d621

9
surf.c
View File

@ -1143,10 +1143,10 @@ decideresource(WebKitPolicyDecision *d, Client *c)
webkit_response_policy_decision_get_response(r); webkit_response_policy_decision_get_response(r);
const gchar *uri = webkit_uri_response_get_uri(res); const gchar *uri = webkit_uri_response_get_uri(res);
if (g_str_has_suffix(uri, "/favicon.ico")) if (g_str_has_suffix(uri, "/favicon.ico")) {
webkit_uri_request_set_uri( webkit_policy_decision_ignore(d);
webkit_response_policy_decision_get_request(r), return;
"about:blank"); }
if (!g_str_has_prefix(uri, "http://") if (!g_str_has_prefix(uri, "http://")
&& !g_str_has_prefix(uri, "https://") && !g_str_has_prefix(uri, "https://")
@ -1164,6 +1164,7 @@ decideresource(WebKitPolicyDecision *d, Client *c)
if (isascii) { if (isascii) {
handleplumb(c, uri); handleplumb(c, uri);
webkit_policy_decision_ignore(d); webkit_policy_decision_ignore(d);
return;
} }
} }