diff options
author | Christoph Lohmann <20h@r-36.net> | 2015-01-20 17:38:22 +0100 |
---|---|---|
committer | Christoph Lohmann <20h@r-36.net> | 2015-01-20 17:38:22 +0100 |
commit | 344efec3fb932a9c5baae582fe70c72a0bc4a747 (patch) | |
tree | fe734d2f3c797ce9e75c095555d4fc6de0be3a5d | |
parent | d4e31d9472ec2f4ec9e44ad56926ee4cfed157ee (diff) | |
download | surf-344efec3fb932a9c5baae582fe70c72a0bc4a747.tar.gz surf-344efec3fb932a9c5baae582fe70c72a0bc4a747.tar.bz2 surf-344efec3fb932a9c5baae582fe70c72a0bc4a747.zip |
Only plumb some URI, when it's ASCII.
-rw-r--r-- | surf.c | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -213,6 +213,7 @@ beforerequest(WebKitWebView *w, WebKitWebFrame *f, WebKitWebResource *r, WebKitNetworkRequest *req, WebKitNetworkResponse *resp, Client *c) { const gchar *uri = webkit_network_request_get_uri(req); + int i, isascii = 1; if(g_str_has_suffix(uri, "/favicon.ico")) webkit_network_request_set_uri(req, "about:blank"); @@ -224,7 +225,15 @@ beforerequest(WebKitWebView *w, WebKitWebFrame *f, WebKitWebResource *r, && !g_str_has_prefix(uri, "data:") \ && !g_str_has_prefix(uri, "blob:") \ && strlen(uri) > 0) { - handleplumb(c, w, uri); + + for(i = 0; i < strlen(uri); i++) { + if(!g_ascii_isprint(uri[i])) { + isascii = 0; + break; + } + } + if(isascii) + handleplumb(c, w, uri); } } |