diff options
author | Gustavo Noronha Silva <gns@gnome.org> | 2008-12-28 02:33:40 +0800 |
---|---|---|
committer | Gustavo Noronha Silva <kov@debian.org> | 2009-05-30 00:15:59 +0800 |
commit | 0ce6fe842a2fc4c3155452f69247cdda97ab09d1 (patch) | |
tree | 47e97153fad4269cac34bb20f188917e8952ba0c /src/ephy-link.c | |
parent | b8fbb465b2dd76b7fd27582fe9d376d870f404e0 (diff) | |
download | gsoc2013-epiphany-0ce6fe842a2fc4c3155452f69247cdda97ab09d1.tar gsoc2013-epiphany-0ce6fe842a2fc4c3155452f69247cdda97ab09d1.tar.gz gsoc2013-epiphany-0ce6fe842a2fc4c3155452f69247cdda97ab09d1.tar.bz2 gsoc2013-epiphany-0ce6fe842a2fc4c3155452f69247cdda97ab09d1.tar.lz gsoc2013-epiphany-0ce6fe842a2fc4c3155452f69247cdda97ab09d1.tar.xz gsoc2013-epiphany-0ce6fe842a2fc4c3155452f69247cdda97ab09d1.tar.zst gsoc2013-epiphany-0ce6fe842a2fc4c3155452f69247cdda97ab09d1.zip |
Move URL normalization out of embed, to a higher level
We need this because not all code that loads URLs goes through embed
now.
Diffstat (limited to 'src/ephy-link.c')
-rw-r--r-- | src/ephy-link.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/ephy-link.c b/src/ephy-link.c index b74ed2bbf..7845dfb62 100644 --- a/src/ephy-link.c +++ b/src/ephy-link.c @@ -21,6 +21,7 @@ #include "ephy-link.h" +#include "ephy-embed-utils.h" #include "ephy-type-builtins.h" #include "ephy-marshal.h" #include "ephy-signal-accumulator.h" @@ -88,13 +89,29 @@ ephy_link_open (EphyLink *link, EphyLinkFlags flags) { EphyEmbed *new_embed = NULL; + char *effective_url = NULL; + + /* + * WebKit does not normalize URI's by itself, so we need to + * handle this ourselves + */ + if (ephy_embed_utils_address_has_web_scheme (address) == FALSE) + { + effective_url = g_strconcat ("http://", address, NULL); + } + else + { + effective_url = g_strdup (address); + } LOG ("ephy_link_open address \"%s\" parent-embed %p flags %u", address, embed, flags); g_signal_emit (link, signals[OPEN_LINK], 0, - address, embed, flags, + effective_url, embed, flags, &new_embed); + g_free (effective_url); + return new_embed; } |