Tests: scgi tests for combining headers.
diff --git a/scgi.t b/scgi.t
index 66a93f0..7d66fa3 100644
--- a/scgi.t
+++ b/scgi.t
@@ -24,7 +24,7 @@
 eval { require SCGI; };
 plan(skip_all => 'SCGI not installed') if $@;
 
-my $t = Test::Nginx->new()->has(qw/http scgi/)->plan(7)
+my $t = Test::Nginx->new()->has(qw/http scgi/)->plan(10)
 	->write_file_expand('nginx.conf', <<'EOF');
 
 %%TEST_GLOBALS%%
@@ -81,6 +81,33 @@
 	'scgi with variables');
 like(http_get('/var?b=u'), qr/SEE-THIS/, 'scgi with variables to upstream');
 
+TODO: {
+local $TODO = 'not yet' unless $t->has_version('1.23.0');
+
+my $r = http(<<EOF);
+GET / HTTP/1.0
+Host: localhost
+X-Forwarded-For: foo
+X-Forwarded-For: bar
+X-Forwarded-For: bazz
+Cookie: foo
+Cookie: bar
+Cookie: bazz
+Foo: foo
+Foo: bar
+Foo: bazz
+
+EOF
+
+like($r, qr/X-Forwarded-For: foo, bar, bazz/,
+	'scgi with multiple X-Forwarded-For headers');
+like($r, qr/X-Cookie: foo; bar; bazz/,
+	'scgi with multiple Cookie headers');
+like($r, qr/X-Foo: foo, bar, bazz/,
+	'scgi with multiple unknown headers');
+
+}
+
 ###############################################################################
 
 sub http_get_headers {
@@ -131,9 +158,16 @@
 
 		$count++;
 
+		my $xfwd = $request->env->{HTTP_X_FORWARDED_FOR} || '';
+		my $cookie = $request->env->{HTTP_COOKIE} || '';
+		my $foo = $request->env->{HTTP_FOO} || '';
+
 		$request->connection()->print(<<EOF);
 Location: http://localhost/redirect
 Content-Type: text/html
+X-Forwarded-For: $xfwd
+X-Cookie: $cookie
+X-Foo: $foo
 
 SEE-THIS
 $count