diff options
author | Xan Lopez <xan@igalia.com> | 2012-02-23 18:56:29 +0800 |
---|---|---|
committer | Xan Lopez <xan@igalia.com> | 2012-02-23 18:57:23 +0800 |
commit | e392e4427ffcdfcffee92549fcf0185cee55b982 (patch) | |
tree | dc39743c7f39018b1f36e65b6bca22cc52aaab1c /embed/ephy-embed-utils.c | |
parent | 6d87cbb12ba7bfe19e19784d2ff04fb369792f89 (diff) | |
download | gsoc2013-epiphany-e392e4427ffcdfcffee92549fcf0185cee55b982.tar.gz gsoc2013-epiphany-e392e4427ffcdfcffee92549fcf0185cee55b982.tar.zst gsoc2013-epiphany-e392e4427ffcdfcffee92549fcf0185cee55b982.zip |
ephy-embed-utils: fix loading of <IP address>:<port> URIs
https://bugzilla.gnome.org/show_bug.cgi?id=669461
Diffstat (limited to 'embed/ephy-embed-utils.c')
-rw-r--r-- | embed/ephy-embed-utils.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/embed/ephy-embed-utils.c b/embed/ephy-embed-utils.c index 2d58fc68b..e01842496 100644 --- a/embed/ephy-embed-utils.c +++ b/embed/ephy-embed-utils.c @@ -117,13 +117,15 @@ ephy_embed_utils_normalize_address (const char *address) * auto-search this?" regex in EphyWebView, so we should be a * valid-ish URL. Auto-prepend http:// to anything that is not * one according to soup, because it probably will be - * something like "google.com". Special case localhost(:port), - * because SoupURI, correctly, thinks it is a URI with scheme - * being localhost and, optionally, path being the - * port. Ideally we should check if we have a handler for the - * scheme, and since we'll fail for localhost, we'd fallback - * to loading it as a domain. */ - if (!uri || (uri && !g_strcmp0 (uri->scheme, "localhost"))) + * something like "google.com". Special case localhost(:port) + * and IP(:port), because SoupURI, correctly, thinks it is a + * URI with scheme being localhost/IP and, optionally, path + * being the port. Ideally we should check if we have a + * handler for the scheme, and since we'll fail for localhost + * and IP, we'd fallback to loading it as a domain. */ + if (!uri || + (uri && !g_strcmp0 (uri->scheme, "localhost")) || + (uri && g_hostname_is_ip_address (uri->scheme))) effective_address = g_strconcat ("http://", address, NULL); else { /* Convert about: schemes to ephy-about: in order to |