]> spindle.queued.net Git - midori/commitdiff
Use Midori.URI API in adblock_resource_request_starting_cb
authorChristian Dywan <christian@twotoasts.de>
Sat, 29 Oct 2011 01:32:16 +0000 (03:32 +0200)
committerChristian Dywan <christian@twotoasts.de>
Sat, 29 Oct 2011 01:32:16 +0000 (03:32 +0200)
extensions/adblock.c

index c76ddba7b7ae5615a764d63a09bdd5f8bc6fff1e..35f8782156650b1eecd5763e80040b7bd610ab07 100644 (file)
@@ -766,21 +766,12 @@ adblock_resource_request_starting_cb (WebKitWebView*         web_view,
         return;
 
     req_uri = webkit_network_request_get_uri (request);
-
-    if (!req_uri)
-        return;
-    if (!strncmp (req_uri, "data", 4) || !strncmp (req_uri, "file", 4))
-        return;
-    if (!strncmp (req_uri, "stock", 5) || !strncmp (req_uri, "res", 3))
-        return;
-
-    if (g_str_has_suffix (req_uri, "favicon.ico"))
+    if (!midori_uri_is_http (req_uri)
+     || g_str_has_suffix (req_uri, "favicon.ico"))
         return;
 
     msg = webkit_network_request_get_message (request);
-    if (!msg)
-        return;
-    if (msg->method && !strncmp (msg->method, "POST", 4))
+    if (!(msg && !g_strcmp0 (msg->method, "GET")))
         return;
 
     #ifdef G_ENABLE_DEBUG