[Libosinfo] [libosinfo PATCH 1/2] tests: test-mediauris: skip non-http URLs
Christophe Fergeau
cfergeau at redhat.com
Wed Aug 2 10:32:31 UTC 2017
Acked-by: Christophe Fergeau <cfergeau at redhat.com>
On Fri, Jul 14, 2017 at 03:32:31PM +0200, Pino Toscano wrote:
> 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 at redhat.com
> https://www.redhat.com/mailman/listinfo/libosinfo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libosinfo/attachments/20170802/9e0b2599/attachment.sig>
More information about the Libosinfo
mailing list