rc-httpd: set charset=utf-8 for all text/* content types
parent
8648e06534
commit
3a3eb0434c
|
@ -32,7 +32,7 @@ case date
|
||||||
do_log 200
|
do_log 200
|
||||||
echo 'HTTP/1.1 200 OK'^$cr
|
echo 'HTTP/1.1 200 OK'^$cr
|
||||||
emit_extra_headers
|
emit_extra_headers
|
||||||
echo 'Content-type: text/html'^$cr
|
echo 'Content-type: text/html; charset=utf-8'^$cr
|
||||||
echo $cr
|
echo $cr
|
||||||
echo '<html>
|
echo '<html>
|
||||||
<head>
|
<head>
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
fn do_error{
|
fn do_error{
|
||||||
echo 'HTTP/1.1 '^$1^$cr
|
echo 'HTTP/1.1 '^$1^$cr
|
||||||
emit_extra_headers
|
emit_extra_headers
|
||||||
echo 'Content-type: text/html'^$cr
|
echo 'Content-type: text/html; charset=utf-8'^$cr
|
||||||
echo $cr
|
echo $cr
|
||||||
echo '<html>
|
echo '<html>
|
||||||
<head>
|
<head>
|
||||||
|
|
|
@ -19,7 +19,7 @@ case *
|
||||||
}
|
}
|
||||||
echo 'Location: ' ^ $2 ^ $cr
|
echo 'Location: ' ^ $2 ^ $cr
|
||||||
emit_extra_headers
|
emit_extra_headers
|
||||||
echo 'Content-type: text/html'^$cr
|
echo 'Content-type: text/html; charset=utf-8'^$cr
|
||||||
echo $cr
|
echo $cr
|
||||||
echo '<html><body>'
|
echo '<html><body>'
|
||||||
if(~ $#3 0)
|
if(~ $#3 0)
|
||||||
|
|
|
@ -23,7 +23,7 @@ case *.html *.htm
|
||||||
case *.css
|
case *.css
|
||||||
type=text/css
|
type=text/css
|
||||||
case *.txt
|
case *.txt
|
||||||
type='text/plain; charset=utf-8'
|
type=text/plain
|
||||||
case *.jpg *.jpeg
|
case *.jpg *.jpeg
|
||||||
type=image/jpeg
|
type=image/jpeg
|
||||||
case *.gif
|
case *.gif
|
||||||
|
@ -33,6 +33,8 @@ case *.png
|
||||||
case *
|
case *
|
||||||
type=`{file -m $full_path}
|
type=`{file -m $full_path}
|
||||||
}
|
}
|
||||||
|
if(~ $type text/*)
|
||||||
|
type=$type^'; charset=utf-8'
|
||||||
max_age=3600 # 1 hour
|
max_age=3600 # 1 hour
|
||||||
echo 'HTTP/1.1 200 OK'^$cr
|
echo 'HTTP/1.1 200 OK'^$cr
|
||||||
emit_extra_headers
|
emit_extra_headers
|
||||||
|
|
Loading…
Reference in New Issue