add a regression test
authorbenno <benno@openbsd.org>
Fri, 22 Jul 2016 09:32:26 +0000 (09:32 +0000)
committerbenno <benno@openbsd.org>
Fri, 22 Jul 2016 09:32:26 +0000 (09:32 +0000)
regress/usr.sbin/relayd/args-http-filter-null-host.pl [new file with mode: 0644]

diff --git a/regress/usr.sbin/relayd/args-http-filter-null-host.pl b/regress/usr.sbin/relayd/args-http-filter-null-host.pl
new file mode 100644 (file)
index 0000000..2ce8f63
--- /dev/null
@@ -0,0 +1,33 @@
+# test http request with null Host header
+
+use strict;
+use warnings;
+
+
+my %header_client = (
+    "Host" => "",
+);
+
+our %args = (
+    client => {
+        func => \&http_client,
+        header => \%header_client,
+       httpnok => 1,
+       nocheck => 1,
+    },
+    relayd => {
+       protocol => [ "http",
+           'pass',
+           'block url "Host"',
+           'return error',
+       ],
+#      loggrep => qr/Forbidden, \[Cookie: med=thx.*/,
+    },
+    server => {
+       func => \&http_server,
+       noserver => 1,
+       nocheck => 1,
+    },
+);
+
+1;