aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXan Lopez <xan@igalia.com>2012-01-24 20:45:28 +0800
committerXan Lopez <xan@igalia.com>2012-01-24 20:45:28 +0800
commiteeeaa0edabfb5fab3cfbdb233ff16a92166e76bb (patch)
tree485791ffb264b1296d3d55419df13d9167d3567e
parent5efccdb2132bbc33ac4907db2c1cdfc638eeac9f (diff)
downloadgsoc2013-epiphany-eeeaa0edabfb5fab3cfbdb233ff16a92166e76bb.tar
gsoc2013-epiphany-eeeaa0edabfb5fab3cfbdb233ff16a92166e76bb.tar.gz
gsoc2013-epiphany-eeeaa0edabfb5fab3cfbdb233ff16a92166e76bb.tar.bz2
gsoc2013-epiphany-eeeaa0edabfb5fab3cfbdb233ff16a92166e76bb.tar.lz
gsoc2013-epiphany-eeeaa0edabfb5fab3cfbdb233ff16a92166e76bb.tar.xz
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!).
-rw-r--r--embed/ephy-embed-utils.c7
-rw-r--r--embed/ephy-web-view.c2
2 files changed, 6 insertions, 3 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;
}
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index 584926bec..8599f76b0 100644
--- a/embed/ephy-web-view.c
+++ b/embed/ephy-web-view.c
@@ -2361,8 +2361,6 @@ normalize_or_autosearch_url (EphyWebView *view, const char *url)
effective_url = g_strdup_printf (url_search, query_param + 2);
g_free (query_param);
g_free (url_search);
- } else if (scheme != NULL) {
- effective_url = g_strdup (url);
} else
effective_url = ephy_embed_utils_normalize_address (url);