summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShaun McCance <shaunm@gnome.org>2020-09-26 14:35:40 -0400
committerShaun McCance <shaunm@gnome.org>2020-10-03 18:42:09 +0000
commit8cf0a54602f9489f04da12cadc9de7a714e56771 (patch)
tree7617f93395ca260299feb1a693e7e79fc04865d4
parent841df9dcba3f6f9f2e8a5664ea8749d4ed2ccf19 (diff)
downloadyelp-8cf0a54602f9489f04da12cadc9de7a714e56771.tar.gz
Don't mangle file: URIs for local HTML files
We do weird things to URIs to make WebKit happy. But if we're just looking at a local HTML file with a file: URI, WebKit is perfectly happy with the URI just the way it is. I hope.
-rw-r--r--libyelp/yelp-uri-builder.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libyelp/yelp-uri-builder.c b/libyelp/yelp-uri-builder.c
index 58a53ac9..6671c110 100644
--- a/libyelp/yelp-uri-builder.c
+++ b/libyelp/yelp-uri-builder.c
@@ -31,6 +31,10 @@ build_network_uri (const gchar *uri)
soup_uri = soup_uri_new (uri);
+ /* Don't mangle URIs for local files */
+ if (g_str_equal (soup_uri->scheme, "file"))
+ return g_strdup (uri);
+
/* Build the URI that will be passed to WebKit. Relative URIs will be
* automatically resolved by WebKit, so we need to add a leading slash to
* help: and ghelp: URIs to be considered as absolute by WebKit.
@@ -103,4 +107,4 @@ gchar *
build_network_scheme (const gchar *scheme)
{
return g_strdup_printf (BOGUS_PREFIX "%s", scheme);
-} \ No newline at end of file
+}