summaryrefslogtreecommitdiff
path: root/regress/usr.sbin/relayd/args-http-append-header.pl
blob: f5acbd1ecf9bb88305ff06ea808c775e1672c2b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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\]\ GET \{X-Header-Server: XYZ\};/ => 1 },
    },
    server => {
	func => \&http_server,
	header => \%header_server,
	loggrep => {
	    "X-Header-Client: ABC" => 1,
	    "X-Header-Client: abc" => 1,
	},
    },
);

1;