rainbows.git  about / heads / tags
Unicorn for sleepy apps and slow clients
blob d8805e3e8e602ef5a7c00a763a46efc2f5e28d43 533 bytes (raw)
$ git show v0.3.0:t/lib-parser-error.sh	# shows this blob on the CLI

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
 
. ./test-lib.sh
echo "parser error test for model=$model"

eval $(unused_listen)
rtmpfiles unicorn_config pid r_err r_out tmp fifo ok

cat > $unicorn_config <<EOF
listen "$listen"
pid "$pid"
stderr_path "$r_err"
stdout_path "$r_out"
Rainbows! { use :$model }
EOF

rainbows -D env.ru -c $unicorn_config
wait_for_pid $pid

(
	printf 'GET / HTTP/1/1\r\nHost: example.com\r\n\r\n'
	cat $fifo > $tmp &
	wait
	echo ok > $ok
) | socat - TCP:$listen > $fifo

kill $(cat $pid)

dbgcat tmp
grep -F 'HTTP/1.1 400 Bad Request' $tmp
check_stderr

git clone https://yhbt.net/rainbows.git