repo.or.cz
/
git
/
raj.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
remote-curl: reencode http error messages
[git/raj.git]
/
t
/
lib-httpd
/
error.sh
blob
eafc9d2d90ff7646062edd9a376839e469334760
1
#!/bin/sh
2
3
printf
"Status: 500 Intentional Breakage
\n
"
4
5
printf
"Content-Type: "
6
charset
=
iso-8859-1
7
case
"
$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
;;
18
*
utf16
*)
19
printf
"text/plain; charset=utf-16"
20
charset
=
utf-16
21
;;
22
esac
23
printf
"
\n
"
24
25
printf
"
\n
"
26
printf
"this is the error message
\n
"
|
27
iconv
-f
us-ascii
-t
$charset