diff options
author | Xan Lopez <xan@igalia.com> | 2012-01-24 20:45:28 +0800 |
---|---|---|
committer | Xan Lopez <xan@igalia.com> | 2012-01-24 20:45:28 +0800 |
commit | eeeaa0edabfb5fab3cfbdb233ff16a92166e76bb (patch) | |
tree | 485791ffb264b1296d3d55419df13d9167d3567e /embed/ephy-embed-utils.c | |
parent | 5efccdb2132bbc33ac4907db2c1cdfc638eeac9f (diff) | |
download | gsoc2013-epiphany-eeeaa0edabfb5fab3cfbdb233ff16a92166e76bb.tar.gz gsoc2013-epiphany-eeeaa0edabfb5fab3cfbdb233ff16a92166e76bb.tar.zst gsoc2013-epiphany-eeeaa0edabfb5fab3cfbdb233ff16a92166e76bb.zip |
Never append "http://" to an address with a scheme
It does not make sense. Fixes opening about: pages after normalizing
all URLs again (and not only those without a scheme!).
Diffstat (limited to 'embed/ephy-embed-utils.c')
-rw-r--r-- | embed/ephy-embed-utils.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/embed/ephy-embed-utils.c b/embed/ephy-embed-utils.c index 5bd5ea79d..5acef0baa 100644 --- a/embed/ephy-embed-utils.c +++ b/embed/ephy-embed-utils.c @@ -107,10 +107,13 @@ char* ephy_embed_utils_normalize_address (const char *address) { char *effective_address = NULL; + char *scheme = NULL; g_return_val_if_fail (address, NULL); - if (ephy_embed_utils_address_has_web_scheme (address) == FALSE) + scheme = g_uri_parse_scheme (address); + + if (scheme == NULL) effective_address = g_strconcat ("http://", address, NULL); else { /* Convert about: schemes to ephy-about: in order to @@ -125,6 +128,8 @@ ephy_embed_utils_normalize_address (const char *address) effective_address = g_strdup (address); } + g_free (scheme); + return effective_address; } |