support for Rack hijack in request and response
[unicorn.git] / t / t0019-max_header_len.sh
blob5ce1c69e6eb8ecf76a2433041a9e360afaa2d0a6
1 #!/bin/sh
2 . ./test-lib.sh
3 t_plan 5 "max_header_len setting (only intended for Rainbows!)"
5 t_begin "setup and start" && {
6 unicorn_setup
7 req='GET / HTTP/1.0\r\n\r\n'
8 len=$(printf "$req" | wc -c)
9 echo Unicorn::HttpParser.max_header_len = $len >> $unicorn_config
10 unicorn -D -c $unicorn_config env.ru
11 unicorn_wait_start
14 t_begin "minimal request succeeds" && {
15 rm -f $tmp
17 cat $fifo > $tmp &
18 printf "$req"
19 wait
20 echo ok > $ok
21 ) | socat - TCP:$listen > $fifo
22 test xok = x$(cat $ok)
24 fgrep "HTTP/1.1 200 OK" $tmp
27 t_begin "big request fails" && {
28 rm -f $tmp
30 cat $fifo > $tmp &
31 printf 'GET /xxxxxx HTTP/1.0\r\n\r\n'
32 wait
33 echo ok > $ok
34 ) | socat - TCP:$listen > $fifo
35 test xok = x$(cat $ok)
36 fgrep "HTTP/1.1 413" $tmp
39 dbgcat tmp
41 t_begin "killing succeeds" && {
42 kill $unicorn_pid
45 t_begin "check stderr" && {
46 check_stderr
49 t_done