[libosinfo PATCH 1/2] tests: test-mediauris: skip non-http URLs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The test uses libsoup, which supports only HTTP, and not other
protocols such as FTP.  Hence, allow only http and https URLs.
---
 tests/test-mediauris.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tests/test-mediauris.c b/tests/test-mediauris.c
index 5bfb4c9..afb055c 100644
--- a/tests/test-mediauris.c
+++ b/tests/test-mediauris.c
@@ -38,7 +38,8 @@ static void test_media(OsinfoMediaList *medialist, GError **error, SoupSession *
         SoupMessage *msg;
         guint status;
 
-        if (url == NULL || g_str_equal(url, "")) {
+        if (url == NULL || g_str_equal(url, "") ||
+            (!g_str_has_prefix(url, "http://";) && !g_str_has_prefix(url, "https://";))) {
             tmp = tmp->next;
             continue;
         }
-- 
2.9.4

_______________________________________________
Libosinfo mailing list
Libosinfo@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libosinfo



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Fedora Users]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux