support for Rack hijack in request and response
[unicorn.git] / t / t0016-trust-x-forwarded-false.sh
blob31636902d8f1071c087487b661353117aa6ebf05
1 #!/bin/sh
2 . ./test-lib.sh
3 t_plan 5 "trust_x_forwarded=false configuration test"
5 t_begin "setup and start" && {
6 unicorn_setup
7 echo "trust_x_forwarded false" >> $unicorn_config
8 unicorn -D -c $unicorn_config env.ru
9 unicorn_wait_start
12 t_begin "spoofed request with X-Forwarded-Proto does not trigger" && {
13 curl -H 'X-Forwarded-Proto: https' http://$listen/ | \
14 grep -F '"rack.url_scheme"=>"http"'
17 t_begin "spoofed request with X-Forwarded-SSL does not trigger" && {
18 curl -H 'X-Forwarded-SSL: on' http://$listen/ | \
19 grep -F '"rack.url_scheme"=>"http"'
22 t_begin "killing succeeds" && {
23 kill $unicorn_pid
26 t_begin "check stderr has no errors" && {
27 check_stderr
30 t_done