Allow relative localhost URIs
This commit is contained in:
parent
b88ba4094f
commit
993fb52644
2 changed files with 2 additions and 1 deletions
|
@ -121,7 +121,7 @@ sokoke_magic_uri (const gchar* uri,
|
|||
if (search && search[0] && !g_ascii_isalpha (search[1]))
|
||||
if (!strchr (search, '.'))
|
||||
return g_strconcat ("http://", uri, NULL);
|
||||
if (!strcmp (uri, "localhost"))
|
||||
if (!strcmp (uri, "localhost") || g_str_has_prefix (uri, "localhost/"))
|
||||
return g_strconcat ("http://", uri, NULL);
|
||||
parts = g_strsplit (uri, ".", 0);
|
||||
if (!search && parts[0] && parts[1])
|
||||
|
|
|
@ -60,6 +60,7 @@ main (int argc,
|
|||
g_free (b);
|
||||
test_input ("localhost", "http://localhost");
|
||||
test_input ("localhost:8000", "http://localhost:8000");
|
||||
test_input ("localhost/rss", "http://localhost/rss");
|
||||
test_input ("192.168.1.1", "http://192.168.1.1");
|
||||
test_input ("192.168.1.1:8000", "http://192.168.1.1:8000");
|
||||
test_input ("sm midori", SM "midori");
|
||||
|
|
Loading…
Reference in a new issue