From 048ae20b3762aac9d01544a31a8d97c3b47c24ef Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Thu, 10 Sep 2020 12:27:39 -0700 Subject: [PATCH] Drop 443 from port if not needed --- miniserv.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/miniserv.pl b/miniserv.pl index d8570f373..9c8bbbb60 100755 --- a/miniserv.pl +++ b/miniserv.pl @@ -1360,7 +1360,8 @@ elsif ($reqline !~ /^(\S+)\s+(.*)\s+HTTP\/1\..$/) { $use_ssl = 0; local $urlhost = $config{'musthost'} || $host; $urlhost = "[".$urlhost."]" if (&check_ip6address($urlhost)); - local $url = "https://$urlhost:$port/"; + local $url = $port == 443 ? "https://$urlhost/" + : "https://$urlhost:$port/"; if ($config{'ssl_redirect'}) { # Just re-direct to the correct URL sleep(1); # Give browser a change to finish