Skip to content

Commit c01a038

Browse files
committed
Tests: fixed stream_proxy_ssl_conf_command.t.
The stream_proxy_ssl_conf_command.t test used stream return module to return the response. Since this ignores actual request, but the perl test code used http_get(). This might result in the request being sent after the response is returned and the connection closed by the server, resulting in RST being generated and no response seen by the client at all. Fix is to use "stream(...)->read()" instead of http_get(), so no request is sent at all, eliminating possibility of RST being generated.
1 parent e739ecb commit c01a038

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

stream_proxy_ssl_conf_command.t

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ BEGIN { use FindBin; chdir($FindBin::Bin); }
1616

1717
use lib 'lib';
1818
use Test::Nginx;
19+
use Test::Nginx::Stream qw/ stream /;
1920

2021
###############################################################################
2122

@@ -81,6 +82,7 @@ $t->try_run('no proxy_ssl_conf_command')->plan(1);
8182

8283
###############################################################################
8384

84-
like(http_get('/'), qr/CN=override/, 'Certificate');
85+
like(stream('127.0.0.1:' . port(8080))->read(), qr/CN=override/,
86+
'Certificate');
8587

8688
###############################################################################

0 commit comments

Comments
 (0)