openresty / test-nginx

Data-driven test scaffold for Nginx C module and OpenResty Lua library development
http://search.cpan.org/dist/Test-Nginx
438 stars 105 forks source link

feature: add '--- curl_options' and '--- curl_protocol' section #125

Closed woodgear closed 2 years ago

woodgear commented 2 years ago

feature: add '--- curl_options' and '--- curl_protocol' section which could combine with '--- http2' to construct a request by curl.

xiaocang commented 2 years ago

Hi @woodgear, documentation is needed here

xiaocang commented 2 years ago

The Test::Nginx document is in pod format (check https://perldoc.perl.org/perlpod for help), and the documentation for these two new options can be just added to the current .pm file like other options

woodgear commented 2 years ago

update to add doc。 not sure I'm doing it right.

woodgear commented 2 years ago

update

woodgear commented 2 years ago

when will this pr merge?

xiaocang commented 2 years ago

Merged with minor tweaks, thanks for the contribution!

diff --git a/lib/Test/Nginx/Socket.pm b/lib/Test/Nginx/Socket.pm
index 6901192..398fbd8 100644
--- a/lib/Test/Nginx/Socket.pm
+++ b/lib/Test/Nginx/Socket.pm
@@ -3011,7 +3011,7 @@ Set protocol (such as http/https) when sending request using 'curl'.

 Add extra command line options when using 'curl' to send request.

-Below example will send https request via curl:
+Below is an example for sending an insecure https request using 'curl':

     --- http2
     --- curl_options: -k
woodgear commented 2 years ago

cool ^_^.