3 skip_models StreamResponseEpoll
5 t_plan
11 "client_max_header_size tests for $model"
7 t_begin
"setup Rainbows!" && {
11 t_begin
"fails with zero size" && {
12 ed
-s $unicorn_config <<EOF
13 ,s/^ client_max_body_size.*/ client_max_header_size 0/
16 grep "client_max_header_size 0" $unicorn_config
17 rainbows
-D env.ru
-c $unicorn_config && die
"should fail"
20 t_begin
"fails with negative value" && {
21 ed
-s $unicorn_config <<EOF
22 ,s/^ client_max_header_size.*/ client_max_header_size -1/
25 grep "client_max_header_size -1" $unicorn_config
26 rainbows
-D env.ru
-c $unicorn_config && die
"should fail"
29 t_begin
"fails with small size" && {
30 ed
-s $unicorn_config <<EOF
31 ,s/^ client_max_header_size.*/ client_max_header_size 7/
34 grep "client_max_header_size 7" $unicorn_config
35 rainbows
-D env.ru
-c $unicorn_config && die
"should fail"
38 t_begin
"starts with minimum value" && {
39 ed
-s $unicorn_config <<EOF
40 ,s/^ client_max_header_size.*/ client_max_header_size 8/
43 grep 'client_max_header_size 8$' $unicorn_config
44 rainbows
-D env.ru
-c $unicorn_config
48 t_begin
"smallest HTTP/0.9 request works right" && {
54 ) | socat
- TCP
:$listen > $fifo
56 test xok
= x
"$(cat $ok)"
57 test 1 -eq $
(count_lines
< $tmp)
58 grep HTTP_VERSION
$tmp && die
"unexpected HTTP_VERSION in HTTP/0.9 request"
61 t_begin
"HTTP/1.1 request fails" && {
62 curl
-vsSf http
://$listen/ > $tmp 2>&1 && die
"unexpected curl success"
63 grep '400\( Bad Request\)\?$' $tmp
66 t_begin
"increase client_max_header_size on reload" && {
67 ed
-s $unicorn_config <<EOF
68 ,s/^ client_max_header_size.*/ client_max_header_size 512/
71 grep 'client_max_header_size 512$' $unicorn_config
72 kill -HUP $rainbows_pid
73 test xSTART
= x
"$(cat $fifo)"
76 t_begin
"HTTP/1.1 request succeeds" && {
77 curl
-sSf http
://$listen/ > $tmp
78 test 1 -eq $
(count_lines
< $tmp)
82 t_begin
"no errors in stderr" && {
86 t_begin
"shutdown" && {