]> git.pld-linux.org Git - packages/lighttpd.git/commitdiff
- add charset to text content-types; default as utf8 auto/th/lighttpd-1_4_30-3
authorElan Ruusamäe <glen@pld-linux.org>
Sun, 22 Jan 2012 20:52:51 +0000 (20:52 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    lighttpd-mime.types.sh -> 1.3
    lighttpd.spec -> 1.355

lighttpd-mime.types.sh
lighttpd.spec

index 455bfa3bfa103ad9e2c39b9bb715309debf0ecfa..6acbe063863bfec2f21a66b1903285b680e68b6c 100644 (file)
@@ -13,7 +13,19 @@ awk '{for (a=2; a <= NF; a++) {printf("%s\t%s\n", $1, $a)}}' | \
 LC_ALL=C sort -u > mime.types
 
 # build lighttpd.conf fragment
-awk '{ printf("\t\".%s\"%s=> \"%s\",\n", $2, (length($2) > 4 ? "\t" : "\t\t"), $1)}' \
+awk '{
+       ext = $2;
+       type = $1;
+       charset = "";
+       # add charset for "text/*" types
+       if (type ~ "text/") {
+               type = "\"" type "; charset=\" + mimetype_textcharset"
+       } else {
+               type = "\"" type "\""
+       }
+
+       printf("\t\".%s\"%s=> %s,\n", ext, (length(ext) > 4 ? "\t" : "\t\t"), type);
+}' \
        < mime.types | LC_ALL=C sort -r > mime.types.conf
 
 # sanity check. there can't be more than one mime type mapping for same extension
@@ -28,6 +40,8 @@ mv -f mime.types.conf mime.types.conf.tmp
 
 # header
 cat >> mime.types.conf <<EOF
+# charset used for "text/*" mimetypes
+mimetype_textcharset = "utf-8"
 # mimetype mapping
 mimetype.assign = (
 EOF
index 4233921e390dd5907a4bbbd0047b8f3effd198fc..61604fad60ccb82321c96cb78830cf09411374ff 100644 (file)
@@ -29,7 +29,7 @@ Summary:      Fast and light HTTP server
 Summary(pl.UTF-8):     Szybki i lekki serwer HTTP
 Name:          lighttpd
 Version:       1.4.30
-Release:       2
+Release:       3
 License:       BSD
 Group:         Networking/Daemons/HTTP
 Source0:       http://download.lighttpd.net/lighttpd/releases-1.4.x/%{name}-%{version}.tar.bz2
This page took 0.263452 seconds and 4 git commands to generate.