commit 3883195affba88be1c694e20458c340c07e91e18
Author: Sergey Poznyakoff <gray@gnu.org>
Date:   Wed Aug 21 00:11:47 2024 +0300
Forwarded: not-needed

    Bugfix
    
    Follow-up to db4a0b44f3.

diff --git a/src/svc.c b/src/svc.c
index 5b5c012..776646c 100644
--- a/src/svc.c
+++ b/src/svc.c
@@ -1154,9 +1154,9 @@ need_rewrite (const char *location, const char *v_host,
 	   || strcasecmp (host, vhost) == 0)
 	  && (memcmp (&be6_addr.sin6_port, &in6_addr.sin6_port,
 		      sizeof (in6_addr.sin6_port)) != 0
-	      || strncasecmp (proto,
-			      !SLIST_EMPTY (&lstn->ctx_head) ? "https" : "http",
-			      matches[1].rm_eo - matches[1].rm_so)))
+	      || is_proto (!SLIST_EMPTY (&lstn->ctx_head) ? "https" : "http",
+			   proto,
+			   matches[1].rm_eo - matches[1].rm_so)))
 	{
 	  free (addr.ai_addr);
 	  free (host);
