diff --git a/tests/data/test2006 b/tests/data/test2006
index 0b84937ed1..4cb61192d7 100644
--- a/tests/data/test2006
+++ b/tests/data/test2006
@@ -85,8 +85,15 @@ Accept: */*
Some data delivered from an HTTP resource
+
+# The Content-Length replace here is to handle with 4/5 digit port number in
+# the content
+
+s/Last-Modified:.*//
+s/Content-Length: 49[67]/Content-Length: yeps/
+
-Content-Length: 496
+Content-Length: yeps
Accept-ranges: bytes
@@ -110,9 +117,6 @@ Metalink: fetching (log/download2006) from (http://%HOSTIP:%HTTPPORT/2006) OK
Metalink: validating (log/download2006)...
Metalink: validating (log/download2006) [sha-256] OK
-
-s/Last-Modified:.*//
-
$_ = '' if (($_ !~ /^Metalink: /) && ($_ !~ /error/i) && ($_ !~ /warn/i))
diff --git a/tests/data/test2007 b/tests/data/test2007
index c8c023efb0..738ac35f96 100644
--- a/tests/data/test2007
+++ b/tests/data/test2007
@@ -86,11 +86,14 @@ Accept: */*
Something delivered from an HTTP resource
+# The Content-Length replace here is to handle with 4/5 digit port number in
+# the content
s/Last-Modified:.*//
+s/Content-Length: 49[67]/Content-Length: yeps/
-Content-Length: 496
+Content-Length: yeps
Accept-ranges: bytes
diff --git a/tests/data/test2008 b/tests/data/test2008
index 570cdba7d3..b29ba911b8 100644
--- a/tests/data/test2008
+++ b/tests/data/test2008
@@ -78,11 +78,14 @@ Accept: */*
Some stuff delivered from an HTTP resource
+# The Content-Length replace here is to handle with 4/5 digit port number in
+# the content
s/Last-Modified:.*//
+s/Content-Length: 49[67]/Content-Length: yeps/
-Content-Length: 496
+Content-Length: yeps
Accept-ranges: bytes
diff --git a/tests/data/test2009 b/tests/data/test2009
index 10f95df4c7..3cf4e4c48f 100644
--- a/tests/data/test2009
+++ b/tests/data/test2009
@@ -79,11 +79,14 @@ Accept: */*
Some contents delivered from an HTTP resource
+# The Content-Length replace here is to handle with 4/5 digit port number in
+# the content
s/Last-Modified:.*//
+s/Content-Length: 49[67]/Content-Length: yeps/
-Content-Length: 496
+Content-Length: yeps
Accept-ranges: bytes
diff --git a/tests/data/test2010 b/tests/data/test2010
index d43f4f1e1a..08f1bfaa44 100644
--- a/tests/data/test2010
+++ b/tests/data/test2010
@@ -78,11 +78,14 @@ Accept: */*
Contents delivered from an HTTP resource
+# The Content-Length replace here is to handle with 4/5 digit port number in
+# the content
s/Last-Modified:.*//
+s/Content-Length: 49[67]/Content-Length: yeps/
-Content-Length: 496
+Content-Length: yeps
Accept-ranges: bytes