unicorn Ruby/Rack server user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
blob 6a355b49cc4ea2ab1a5ef7d323a6be675588b0e0 874 bytes (raw)

 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
 
#!/bin/sh
. ./test-lib.sh
t_plan 5 "max_header_len setting (only intended for Rainbows!)"

t_begin "setup and start" && {
	unicorn_setup
	req='GET / HTTP/1.0\r\n\r\n'
	len=$(printf "$req" | count_bytes)
	echo Unicorn::HttpParser.max_header_len = $len >> $unicorn_config
	unicorn -D -c $unicorn_config env.ru
	unicorn_wait_start
}

t_begin "minimal request succeeds" && {
	rm -f $tmp
	(
		cat $fifo > $tmp &
		printf "$req"
		wait
		echo ok > $ok
	) | socat - TCP:$listen > $fifo
	test xok = x$(cat $ok)

	fgrep "HTTP/1.1 200 OK" $tmp
}

t_begin "big request fails" && {
	rm -f $tmp
	(
		cat $fifo > $tmp &
		printf 'GET /xxxxxx HTTP/1.0\r\n\r\n'
		wait
		echo ok > $ok
	) | socat - TCP:$listen > $fifo
	test xok = x$(cat $ok)
	fgrep "HTTP/1.1 413" $tmp
}

dbgcat tmp

t_begin "killing succeeds" && {
	kill $unicorn_pid
}

t_begin "check stderr" && {
	check_stderr
}

t_done

debug log:

solving 6a355b4 ...
found 6a355b4 in https://yhbt.net/unicorn.git/

Code repositories for project(s) associated with this public inbox

	https://yhbt.net/unicorn.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).