proxy-test: fix check for simple:// URI scheme

This has no practical impact, since it's only a test, and none of the
test code would have hit this bug, but the GTestProxyResolver's check to
see if the URI scheme is simple:// currently only compares the first
four bytes of the string, so it's actually only checking for the "simp"
and would match anything else after that, e.g. "simpleton://". This is
surely not intended.
This commit is contained in:
Michael Catanzaro 2022-06-07 15:07:35 -05:00
parent 6d381c9668
commit 4667f5980a

View File

@ -131,7 +131,7 @@ g_test_proxy_resolver_lookup (GProxyResolver *resolver,
proxies = g_new (gchar *, 3);
if (!strncmp (uri, "simple://", 4))
if (g_str_has_prefix (uri, "simple://"))
{
proxies[0] = g_strdup ("direct://");
proxies[1] = NULL;