@@ -105,28 +105,28 @@ like(http_get('/cache/chunked'), qr/MISS/, 'unfinished chunked');
105
105
106
106
# make sure there is no final chunk in unfinished responses
107
107
108
- like(http_get_11(' /length' ), qr / unfinished(?!.* \x0d\x0a ?0 \x0d\x0a ?) / s ,
108
+ like(http_get_11(' /length' ), qr / unfinished.*no-last-chunk / s ,
109
109
' length no final chunk' );
110
- like(http_get_11(' /chunked' ), qr / unfinished(?!.* \x0d\x0a ?0 \x0d\x0a ?) / s ,
110
+ like(http_get_11(' /chunked' ), qr / unfinished.*no-last-chunk / s ,
111
111
' chunked no final chunk' );
112
112
113
113
# but there is final chunk in complete responses
114
114
115
- like(http_get_11(' /length/ok' ), qr / finished.* \x0d\x0a ?0 \x0d\x0a ? / s ,
115
+ like(http_get_11(' /length/ok' ), qr / finished\x0d\x0a $ / s ,
116
116
' length final chunk' );
117
- like(http_get_11(' /chunked/ok' ), qr / finished.* \x0d\x0a ?0 \x0d\x0a ? / s ,
117
+ like(http_get_11(' /chunked/ok' ), qr / finished\x0d\x0a $ / s ,
118
118
' chunked final chunk' );
119
119
120
120
# the same with proxy_buffering set to off
121
121
122
- like(http_get_11(' /un/length' ), qr / unfinished(?!.* \x0d\x0a ?0 \x0d\x0a ?) / s ,
122
+ like(http_get_11(' /un/length' ), qr / unfinished.*no-last-chunk / s ,
123
123
' unbuffered length no final chunk' );
124
- like(http_get_11(' /un/chunked' ), qr / unfinished(?!.* \x0d\x0a ?0 \x0d\x0a ?) / s ,
124
+ like(http_get_11(' /un/chunked' ), qr / unfinished.*no-last-chunk / s ,
125
125
' unbuffered chunked no final chunk' );
126
126
127
- like(http_get_11(' /un/length/ok' ), qr / finished.* \x0d\x0a ?0 \x0d\x0a ? / s ,
127
+ like(http_get_11(' /un/length/ok' ), qr / finished\x0d\x0a $ / s ,
128
128
' unbuffered length final chunk' );
129
- like(http_get_11(' /un/chunked/ok' ), qr / finished.* \x0d\x0a ?0 \x0d\x0a ? / s ,
129
+ like(http_get_11(' /un/chunked/ok' ), qr / finished\x0d\x0a $ / s ,
130
130
' unbuffered chunked final chunk' );
131
131
132
132
# big responses
@@ -144,7 +144,7 @@ chmod(0000, $t->testdir() . '/proxy_temp');
144
144
my $r = http_get_11(' /proxy/big.html' , sleep => 0.5);
145
145
146
146
SKIP: {
147
- skip ' finished' , 1 if length (http_content( $r ) ) == 1024 * 1024 + 8;
147
+ skip ' finished' , 1 if length ($r ) == 1024 * 1024 + 8;
148
148
149
149
like($r , qr / X(?!.*\x0d\x0a ?0\x0d\x0a ?)/ s , ' no proxy temp' );
150
150
@@ -157,12 +157,12 @@ chmod(0700, $t->testdir() . '/proxy_temp');
157
157
sub http_get_11 {
158
158
my ($uri , %extra ) = @_ ;
159
159
160
- return http(
160
+ return http_content( http(
161
161
" GET $uri HTTP/1.1" . CRLF .
162
162
" Connection: close" . CRLF .
163
163
" Host: localhost" . CRLF . CRLF,
164
164
%extra
165
- );
165
+ )) ;
166
166
}
167
167
168
168
# ##############################################################################
0 commit comments