diff --git a/src/as-utils.c b/src/as-utils.c index a27860d8..2d91a4db 100644 --- a/src/as-utils.c +++ b/src/as-utils.c @@ -2262,6 +2262,7 @@ as_utils_dns_to_rdns (const gchar *url, const gchar *suffix) new_cid = g_string_new (suffix); for (i = 0; parts[i] != NULL; i++) { if (g_strcmp0 (parts[i], "www") != 0) { + g_strdelimit (parts[i], "-", '_'); g_string_prepend_c (new_cid, '.'); g_string_prepend (new_cid, parts[i]); } diff --git a/tests/test-basics.c b/tests/test-basics.c index 2feabb45..38f83836 100644 --- a/tests/test-basics.c +++ b/tests/test-basics.c @@ -1304,6 +1304,10 @@ test_rdns_convert (void) tmp = as_utils_dns_to_rdns ("https://example.com", "MyApp"); g_assert_cmpstr (tmp, ==, "com.example.MyApp"); g_free (tmp); + + tmp = as_utils_dns_to_rdns ("https://my-example.org", "My-App"); + g_assert_cmpstr (tmp, ==, "org.my_example.My-App"); + g_free (tmp); } /**