t / lib-httpd / error.shon commit http: extract type/subtype portion of content-type (bf197fd)
   1#!/bin/sh
   2
   3printf "Status: 500 Intentional Breakage\n"
   4
   5printf "Content-Type: "
   6charset=iso-8859-1
   7case "$PATH_INFO" in
   8*html*)
   9        printf "text/html"
  10        ;;
  11*text*)
  12        printf "text/plain"
  13        ;;
  14*charset*)
  15        printf "text/plain; charset=utf-8"
  16        charset=utf-8
  17        ;;
  18esac
  19printf "\n"
  20
  21printf "\n"
  22printf "this is the error message\n" |
  23iconv -f us-ascii -t $charset