[epiphany] Never append "http://" to an address with a scheme



commit eeeaa0edabfb5fab3cfbdb233ff16a92166e76bb
Author: Xan Lopez <xan igalia com>
Date:   Tue Jan 24 13:45:28 2012 +0100

    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!).

 embed/ephy-embed-utils.c |    7 ++++++-
 embed/ephy-web-view.c    |    2 --
 2 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/embed/ephy-embed-utils.c b/embed/ephy-embed-utils.c
index 5bd5ea7..5acef0b 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 584926b..8599f76 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);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]