Properly pass external addresses with libSoup 2.27.90
This commit is contained in:
parent
fa8f109da9
commit
0ac4de8aa5
3 changed files with 14 additions and 4 deletions
|
@ -1776,13 +1776,19 @@ main (int argc,
|
|||
i = 0;
|
||||
while (uris[i] != NULL)
|
||||
{
|
||||
#if GLIB_CHECK_VERSION (2, 22, 0)
|
||||
gchar* encoded = g_hostname_to_unicode (uris[i]);
|
||||
#ifdef HAVE_LIBSOUP_2_27_90
|
||||
gchar* path;
|
||||
gchar* hostname = sokoke_hostname_from_uri (uris[i], &path);
|
||||
gchar* encoded = g_hostname_to_ascii (hostname);
|
||||
|
||||
if (encoded)
|
||||
{
|
||||
gchar* res = g_strconcat ("http://", encoded, path, NULL);
|
||||
g_free (uris[i]);
|
||||
uris[i] = encoded;
|
||||
g_free (encoded);
|
||||
uris[i] = res;
|
||||
}
|
||||
g_free (hostname);
|
||||
#else
|
||||
uris[i] = sokoke_idn_to_punycode (uris[i]);
|
||||
#endif
|
||||
|
|
|
@ -197,7 +197,7 @@ sokoke_spawn_program (const gchar* command,
|
|||
*
|
||||
* Return value: a newly allocated hostname
|
||||
**/
|
||||
static gchar*
|
||||
gchar*
|
||||
sokoke_hostname_from_uri (const gchar* uri,
|
||||
gchar** path)
|
||||
{
|
||||
|
|
|
@ -41,6 +41,10 @@ sokoke_spawn_program (const gchar* command,
|
|||
gchar* sokoke_search_uri (const gchar* uri,
|
||||
const gchar* keywords);
|
||||
|
||||
gchar*
|
||||
sokoke_hostname_from_uri (const gchar* uri,
|
||||
gchar** path);
|
||||
|
||||
gchar*
|
||||
sokoke_idn_to_punycode (gchar* uri);
|
||||
|
||||
|
|
Loading…
Reference in a new issue