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