From: Alexandru Mihail <alexandru.mihail2897@gmail.com>
Date: Thu Sep 21 01:19:42 AM EEST 2023
Subject: strip-port-numbers-in-vhost
Bug-Debian: https://bugs.debian.org/491078
---
 mini_httpd.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/mini_httpd.c b/mini_httpd.c
index b9c5c27..29461b3 100644
--- a/mini_httpd.c
+++ b/mini_httpd.c
@@ -2445,7 +2445,13 @@ virtual_file( char* f )
 
     /* Use the request's hostname, or fall back on the IP address. */
     if ( host != (char*) 0 )
+	{
 	req_hostname = host;
+	char *portno;
+	portno = strpbrk(req_hostname, ":");
+	if (portno != (char *) 0)
+		*portno++ = '\0';
+	}
     else
 	{
 	usockaddr usa;
