Welcome! Log In Create A New Profile

Advanced

[PATCH 1 of 3] Tests: add test library function for simple HTTP/1.1 request

Shawn J. Goff
January 02, 2015 07:08PM
# HG changeset patch
# User Shawn J. Goff <shawgoff@amazon.com>
# Date 1418866454 28800
# Node ID 130a511d3faa26f79225dff7ef6796f4d39bc482
# Parent b2c3d509b2f90c97bfc79f64cb93e3d12ec6e40a
Tests: add test library function for simple HTTP/1.1 request.

This is for the upcomming propagate_connection_close tests.

diff -r b2c3d509b2f9 -r 130a511d3faa lib/Test/Nginx.pm
--- a/lib/Test/Nginx.pm Wed Dec 24 14:15:30 2014 +0300
+++ b/lib/Test/Nginx.pm Wed Dec 17 17:34:14 2014 -0800
@@ -11,7 +11,7 @@

use base qw/ Exporter /;

-our @EXPORT = qw/ log_in log_out http http_get http_head /;
+our @EXPORT = qw/ log_in log_out http http_get http_get_v11 http_head /;
our @EXPORT_OK = qw/ http_gzip_request http_gzip_like http_start http_end /;
our %EXPORT_TAGS = (
gzip => [ qw/ http_gzip_request http_gzip_like / ]
@@ -450,15 +450,23 @@

###############################################################################

-sub http_get($;%) {
- my ($url, %extra) = @_;
+sub http_get_v($;%) {
+ my ($ver, $url, %extra) = @_;
return http(<<EOF, %extra);
-GET $url HTTP/1.0
+GET $url HTTP/$ver
Host: localhost

EOF
}

+sub http_get_v11($;%) {
+ return http_get_v('1.1', @_);
+}
+
+sub http_get($;%) {
+ return http_get_v('1.0', @_);
+}
+
sub http_head($;%) {
my ($url, %extra) = @_;
return http(<<EOF, %extra);

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[PATCH 1 of 3] Tests: add test library function for simple HTTP/1.1 request

Shawn J. Goff 736 January 02, 2015 07:08PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 153
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready