summaryrefslogtreecommitdiff
path: root/regress/usr.sbin
diff options
context:
space:
mode:
authorSebastian Benoit <benno@cvs.openbsd.org>2014-07-12 15:47:19 +0000
committerSebastian Benoit <benno@cvs.openbsd.org>2014-07-12 15:47:19 +0000
commit6a6bdf51d050bd64e21dc788bf739acda349e1be (patch)
tree9d7254b0704a1b005d76aa7bf854d01ea176f746 /regress/usr.sbin
parent5035ff8a1ebd35b86dba73727e6d348a2dd4430f (diff)
fix relay "append header" action, add regression test for append
ok reyk
Diffstat (limited to 'regress/usr.sbin')
-rw-r--r--regress/usr.sbin/relayd/args-http-append-header.pl40
1 files changed, 40 insertions, 0 deletions
diff --git a/regress/usr.sbin/relayd/args-http-append-header.pl b/regress/usr.sbin/relayd/args-http-append-header.pl
new file mode 100644
index 00000000000..f7344458ec6
--- /dev/null
+++ b/regress/usr.sbin/relayd/args-http-append-header.pl
@@ -0,0 +1,40 @@
+# test appending headers, both directions
+
+use strict;
+use warnings;
+
+my %header_client = (
+ "X-Header-Client" => "ABC",
+);
+my %header_server = (
+ "X-Header-Server" => "XYZ",
+);
+our %args = (
+ client => {
+ func => \&http_client,
+ header => \%header_client,
+ loggrep => {
+ "X-Header-Server: XYZ" => 1,
+ "X-Header-Server: xyz" => 1,
+ },
+ },
+ relayd => {
+ protocol => [ "http",
+ 'match request header append "X-Header-Client" value "abc"',
+ 'match response header append "X-Header-Server" value "xyz"',
+ 'match request header log "X-Header*"',
+ 'match response header log "X-Header*"',
+ ],
+ loggrep => { qr/ (?:done|last write \(done\)), \[X-Header-Client: ABC\]\ \[X-Header-Server: XYZ\]/ => 1 },
+ },
+ server => {
+ func => \&http_server,
+ header => \%header_server,
+ loggrep => {
+ "X-Header-Client: ABC" => 1,
+ "X-Header-Client: abc" => 1,
+ },
+ },
+);
+
+1;