]> sjero.net Git - wget/blobdiff - tests/HTTPServer.pm
Don't use hardcoded ports.
[wget] / tests / HTTPServer.pm
index a307b737310cb644abb489d1132d06211d02e38f..dbfa3ef1ce8cea7d87c2c1d140d5634b018a60b9 100644 (file)
@@ -120,6 +120,7 @@ sub send_response {
             next;
         }
         # fill in content
+        $content = $self->_substitute_port($content);
         $resp->content($content);
         print STDERR "HTTP::Response with content: \n", $resp->as_string if $log;
     }
@@ -207,6 +208,13 @@ sub verify_auth_basic {
     }
 }
 
+sub _substitute_port {
+    my $self = shift;
+    my $ret = shift;
+    $ret =~ s/{{port}}/$self->sockport/eg;
+    return $ret;
+}
+
 1;
 
 # vim: et ts=4 sw=4