[nginx-tests] Tests: fixed server_tokens.t to accept alternative...
Maxim Dounin
mdounin at mdounin.ru
Thu Feb 29 04:03:55 UTC 2024
details: http://freenginx.org/hg/nginx-tests/rev/e0b55129fbbf
branches:
changeset: 1950:e0b55129fbbf
user: Maxim Dounin <mdounin at mdounin.ru>
date: Thu Feb 29 06:54:19 2024 +0300
description:
Tests: fixed server_tokens.t to accept alternative names.
diffstat:
server_tokens.t | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diffs (23 lines):
diff --git a/server_tokens.t b/server_tokens.t
--- a/server_tokens.t
+++ b/server_tokens.t
@@ -91,15 +91,15 @@ EOF
###############################################################################
-my $re = qr/nginx\/\d+\.\d+\.\d+/;
+my $re = qr/\w+\/\d+\.\d+\.\d+/;
like(http_get_server('/200'), $re, 'tokens default 200');
like(http_get_server('/404'), $re, 'tokens default 404');
like(http_body('/404'), $re, 'tokens default 404 body');
-is(http_get_server('/off/200'), 'nginx', 'tokens off 200');
-is(http_get_server('/off/404'), 'nginx', 'tokens off 404');
-like(http_body('/off/404'), qr/nginx(?!\/)/, 'tokens off 404 body');
+like(http_get_server('/off/200'), qr/^\w+$/, 'tokens off 200');
+like(http_get_server('/off/404'), qr/^\w+$/, 'tokens off 404');
+unlike(http_body('/off/404'), $re, 'tokens off 404 body');
like(http_get_server('/on/200'), $re, 'tokens on 200');
like(http_get_server('/on/404'), $re, 'tokens on 404');
More information about the nginx-devel
mailing list