Only plumb some URI, when it's ASCII.
This commit is contained in:
parent
d4e31d9472
commit
344efec3fb
9
surf.c
9
surf.c
|
@ -213,6 +213,7 @@ beforerequest(WebKitWebView *w, WebKitWebFrame *f, WebKitWebResource *r,
|
||||||
WebKitNetworkRequest *req, WebKitNetworkResponse *resp,
|
WebKitNetworkRequest *req, WebKitNetworkResponse *resp,
|
||||||
Client *c) {
|
Client *c) {
|
||||||
const gchar *uri = webkit_network_request_get_uri(req);
|
const gchar *uri = webkit_network_request_get_uri(req);
|
||||||
|
int i, isascii = 1;
|
||||||
|
|
||||||
if(g_str_has_suffix(uri, "/favicon.ico"))
|
if(g_str_has_suffix(uri, "/favicon.ico"))
|
||||||
webkit_network_request_set_uri(req, "about:blank");
|
webkit_network_request_set_uri(req, "about:blank");
|
||||||
|
@ -224,6 +225,14 @@ beforerequest(WebKitWebView *w, WebKitWebFrame *f, WebKitWebResource *r,
|
||||||
&& !g_str_has_prefix(uri, "data:") \
|
&& !g_str_has_prefix(uri, "data:") \
|
||||||
&& !g_str_has_prefix(uri, "blob:") \
|
&& !g_str_has_prefix(uri, "blob:") \
|
||||||
&& strlen(uri) > 0) {
|
&& strlen(uri) > 0) {
|
||||||
|
|
||||||
|
for(i = 0; i < strlen(uri); i++) {
|
||||||
|
if(!g_ascii_isprint(uri[i])) {
|
||||||
|
isascii = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(isascii)
|
||||||
handleplumb(c, w, uri);
|
handleplumb(c, w, uri);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user