diff options
author | Andrey Zelenkov <zelenkov@nginx.com> | 2018-05-21 16:41:33 +0300 |
---|---|---|
committer | Andrey Zelenkov <zelenkov@nginx.com> | 2018-05-21 16:41:33 +0300 |
commit | 7d224bfc9e39cb7885885bb554ca21ab26f5ddd0 (patch) | |
tree | b64a349507a19c1d3fdc5f6bbfda06e65db806a9 /test | |
parent | 3e8dbfe5ffdfbf525dd115508dc28d15bb81a237 (diff) | |
download | unit-7d224bfc9e39cb7885885bb554ca21ab26f5ddd0.tar.gz unit-7d224bfc9e39cb7885885bb554ca21ab26f5ddd0.tar.bz2 |
Tests: added tests for SERVER_SOFTWARE variable.
Diffstat (limited to 'test')
-rw-r--r-- | test/perl/variables/psgi.pl | 1 | ||||
-rw-r--r-- | test/python/variables/wsgi.py | 1 | ||||
-rw-r--r-- | test/ruby/variables/config.ru | 1 | ||||
-rw-r--r-- | test/test_perl_application.py | 6 | ||||
-rw-r--r-- | test/test_python_application.py | 6 | ||||
-rw-r--r-- | test/test_ruby_application.py | 6 |
6 files changed, 15 insertions, 6 deletions
diff --git a/test/perl/variables/psgi.pl b/test/perl/variables/psgi.pl index bed20af8..58232c53 100644 --- a/test/perl/variables/psgi.pl +++ b/test/perl/variables/psgi.pl @@ -13,6 +13,7 @@ my $app = sub { 'Request-Uri' => $environ->{'REQUEST_URI'}, 'Http-Host' => $environ->{'HTTP_HOST'}, 'Server-Protocol' => $environ->{'SERVER_PROTOCOL'}, + 'Server-Software' => $environ->{'SERVER_SOFTWARE'}, 'Custom-Header' => $environ->{'HTTP_CUSTOM_HEADER'}, 'Psgi-Version' => $version, 'Psgi-Url-Scheme' => $environ->{'psgi.url_scheme'}, diff --git a/test/python/variables/wsgi.py b/test/python/variables/wsgi.py index 60fa3401..53991e5e 100644 --- a/test/python/variables/wsgi.py +++ b/test/python/variables/wsgi.py @@ -10,6 +10,7 @@ def application(environ, start_response): ('Request-Uri', environ.get('REQUEST_URI')), ('Http-Host', environ.get('HTTP_HOST')), ('Server-Protocol', environ.get('SERVER_PROTOCOL')), + ('Server-Software', environ.get('SERVER_SOFTWARE')), ('Custom-Header', environ.get('HTTP_CUSTOM_HEADER')), ('Wsgi-Version', str(environ['wsgi.version'])), ('Wsgi-Url-Scheme', environ['wsgi.url_scheme']), diff --git a/test/ruby/variables/config.ru b/test/ruby/variables/config.ru index 4caac3c2..55d01796 100644 --- a/test/ruby/variables/config.ru +++ b/test/ruby/variables/config.ru @@ -9,6 +9,7 @@ app = Proc.new do |env| 'Request-Uri' => env['REQUEST_URI'], 'Http-Host' => env['HTTP_HOST'], 'Server-Protocol' => env['SERVER_PROTOCOL'], + 'Server-Software' => env['SERVER_SOFTWARE'], 'Custom-Header' => env['HTTP_CUSTOM_HEADER'], 'Rack-Version' => version, 'Rack-Url-Scheme' => env['rack.url_scheme'], diff --git a/test/test_perl_application.py b/test/test_perl_application.py index 884c6dfb..09e3d576 100644 --- a/test/test_perl_application.py +++ b/test/test_perl_application.py @@ -19,8 +19,10 @@ class TestUnitPerlApplication(unit.TestUnitApplicationPerl): self.assertEqual(resp['status'], 200, 'status') headers = resp['headers'] - self.assertRegex(headers.pop('Server'), r'Unit/[\d\.]+', - 'server header') + header_server = headers.pop('Server') + self.assertRegex(header_server, r'Unit/[\d\.]+', 'server header') + self.assertEqual(headers.pop('Server-Software'), header_server, + 'server software header') date = headers.pop('Date') self.assertEqual(date[-4:], ' GMT', 'date header timezone') diff --git a/test/test_python_application.py b/test/test_python_application.py index d7913a1d..39fd970c 100644 --- a/test/test_python_application.py +++ b/test/test_python_application.py @@ -19,8 +19,10 @@ class TestUnitPythonApplication(unit.TestUnitApplicationPython): self.assertEqual(resp['status'], 200, 'status') headers = resp['headers'] - self.assertRegex(headers.pop('Server'), r'Unit/[\d\.]+', - 'server header') + header_server = headers.pop('Server') + self.assertRegex(header_server, r'Unit/[\d\.]+', 'server header') + self.assertEqual(headers.pop('Server-Software'), header_server, + 'server software header') date = headers.pop('Date') self.assertEqual(date[-4:], ' GMT', 'date header timezone') diff --git a/test/test_ruby_application.py b/test/test_ruby_application.py index 035ae65e..77040127 100644 --- a/test/test_ruby_application.py +++ b/test/test_ruby_application.py @@ -19,8 +19,10 @@ class TestUnitRubyApplication(unit.TestUnitApplicationRuby): self.assertEqual(resp['status'], 200, 'status') headers = resp['headers'] - self.assertRegex(headers.pop('Server'), r'Unit/[\d\.]+', - 'server header') + header_server = headers.pop('Server') + self.assertRegex(header_server, r'Unit/[\d\.]+', 'server header') + self.assertEqual(headers.pop('Server-Software'), header_server, + 'server software header') date = headers.pop('Date') self.assertEqual(date[-4:], ' GMT', 'date header timezone') |