diff options
author | Patrick McDermott <pj@pehjota.net> | 2017-11-04 18:42:40 (EDT) |
---|---|---|
committer | Patrick McDermott <pj@pehjota.net> | 2017-11-04 18:42:40 (EDT) |
commit | 18bb954f220d97cf5d26a4a89088b6556b427563 (patch) | |
tree | fc060c4f8a1e341067e2afe368885e7a6c3cb1a0 | |
parent | fe7427fa6ceeb8567e9ed53397226ae2f29f0ff7 (diff) | |
download | marquee-18bb954f220d97cf5d26a4a89088b6556b427563.zip marquee-18bb954f220d97cf5d26a4a89088b6556b427563.tar.gz marquee-18bb954f220d97cf5d26a4a89088b6556b427563.tar.bz2 |
mq_web_view_normal_scheme_methods.rewrite_uri(): Hide query of about-scheme URIs
-rw-r--r-- | src/web-view-schemes/normal.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/web-view-schemes/normal.c b/src/web-view-schemes/normal.c index c4d42b8..f6344f8 100644 --- a/src/web-view-schemes/normal.c +++ b/src/web-view-schemes/normal.c @@ -76,8 +76,16 @@ static gchar * rewrite_uri(MqWebView G_GNUC_UNUSED *web_view, MqWebViewScheme G_GNUC_UNUSED *scheme, const gchar *uri) { + gchar *rw_uri; + gchar *query; + if (g_str_has_prefix(uri, "about:")) { - return g_strconcat("mq-about:", uri + strlen("about:"), NULL); + rw_uri = g_strconcat("mq-about:", uri + strlen("about:"), NULL); + query = strchr(rw_uri, '?'); + if (query) { + query[0] = '\0'; + } + return rw_uri; } else { return g_strdup(uri); } |