2014-05-22 17:29:03 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
printf "Status: 500 Intentional Breakage\n"
|
|
|
|
|
|
|
|
printf "Content-Type: "
|
2014-05-22 17:29:47 +08:00
|
|
|
charset=iso-8859-1
|
2014-05-22 17:29:03 +08:00
|
|
|
case "$PATH_INFO" in
|
|
|
|
*html*)
|
|
|
|
printf "text/html"
|
|
|
|
;;
|
|
|
|
*text*)
|
|
|
|
printf "text/plain"
|
|
|
|
;;
|
2014-05-22 17:29:47 +08:00
|
|
|
*charset*)
|
|
|
|
printf "text/plain; charset=utf-8"
|
|
|
|
charset=utf-8
|
|
|
|
;;
|
2014-05-22 17:30:29 +08:00
|
|
|
*utf16*)
|
|
|
|
printf "text/plain; charset=utf-16"
|
|
|
|
charset=utf-16
|
|
|
|
;;
|
2014-06-18 06:11:53 +08:00
|
|
|
*odd-spacing*)
|
|
|
|
printf "text/plain; foo=bar ;charset=utf-16; other=nonsense"
|
|
|
|
charset=utf-16
|
|
|
|
;;
|
2014-05-22 17:29:03 +08:00
|
|
|
esac
|
|
|
|
printf "\n"
|
|
|
|
|
|
|
|
printf "\n"
|
2014-05-22 17:29:47 +08:00
|
|
|
printf "this is the error message\n" |
|
|
|
|
iconv -f us-ascii -t $charset
|