Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from Sep 28, 2021

Conversation

woodgear
Copy link
Contributor

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

@xiaocang
Copy link
Contributor

xiaocang commented Sep 26, 2021

Hi @woodgear, documentation is needed here

@xiaocang
Copy link
Contributor

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
Copy link
Contributor Author

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

@@ -2993,6 +3003,14 @@ C<--- raw_request>.

See also the L<TEST_NGINX_USE_HTTP2> system environment for the "http2" test mode.

=head2 curl_options

add curl options when use 'curl' to send request.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add extra command line options when using 'curl' to send request should be better here

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And, you can give a useful example here


=head2 curl_protocol

set protocol such as http/https when use 'curl' to send request.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Set protocol (such as http/https) when sending request using 'curl' may be better here

@woodgear
Copy link
Contributor Author

update

lib/Test/Nginx/Socket.pm Outdated Show resolved Hide resolved
… could combine with '--- http2' to construct a request by curl.
Copy link
Contributor

@xiaocang xiaocang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@woodgear
Copy link
Contributor Author

when will this pr merge?

@xiaocang xiaocang merged commit e2f0b9c into openresty:master Sep 28, 2021
@xiaocang
Copy link
Contributor

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
Copy link
Contributor Author

cool ^_^.

@woodgear woodgear deleted the feature/more-curl-section branch September 28, 2021 07:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants