Changeset 2837 for trunk/server
- Timestamp:
- Apr 10, 2017, 4:56:03 AM (8 years ago)
- Location:
- trunk/server
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/server/common/oursrc/scripts-static-cat/StaticCat.hs
r2796 r2837 23 23 import System.Posix.Handle 24 24 25 encodings :: M.Map String String26 encodings = M.fromList [27 (".bz2", "bzip2"),28 (".gz", "gzip"),29 (".z", "compress")30 ]31 32 25 types :: M.Map String String 33 26 types = M.fromList [ … … 49 42 (".jpeg", "image/jpeg"), 50 43 (".jpg", "image/jpeg"), 51 (".js", "application/ x-javascript"),44 (".js", "application/javascript"), 52 45 (".mid", "audio/midi"), 53 46 (".midi", "audio/midi"), … … 88 81 (".swf", "application/x-shockwave-flash"), 89 82 (".tar", "application/x-tar"), 90 (".tgz", "application/ x-gzip"),83 (".tgz", "application/gzip"), 91 84 (".tif", "image/tiff"), 92 85 (".tiff", "image/tiff"), … … 109 102 (".xltx", "application/vnd.openxmlformats-officedocument.spreadsheetml.template"), 110 103 (".xml", "text/xml"), 111 (".xsl", " text/xml"),104 (".xsl", "application/xslt+xml"), 112 105 (".zip", "application/zip") 113 106 ] … … 126 119 127 120 checkExtension :: FilePath -> CGI () 128 checkExtension file = do 129 let (base, ext) = splitExtension file 130 ext' <- case M.lookup (map toLower ext) encodings of 131 Nothing -> return ext 132 Just e -> do 133 setHeader "Content-Encoding" e 134 return $ takeExtension base 135 136 case M.lookup (map toLower ext') types of 121 checkExtension file = 122 case M.lookup (map toLower (takeExtension file)) types of 137 123 Nothing -> throw Forbidden 138 124 Just t -> setHeader "Content-Type" t -
trunk/server/fedora/config/etc/httpd/conf/httpd.conf
r2822 r2837 218 218 219 219 <IfModule mod_mime.c> 220 AddType application/xhtml+xml .xhtml221 AddType application/http-index-format .hti222 AddType text/html .html223 AddType text/css .css224 AddType text/xsl .xslt225 AddType application/x-javascript .js226 AddType application/xml .xml227 AddType image/svg+xml .svg228 AddType application/vnd.mozilla.xul+xml .xul229 AddType application/rdf+xml .rdf230 AddType application/x-xpinstall .xpi231 AddType text/xml .xsl232 AddType text/html .shtml233 220 AddHandler server-parsed .shtml 234 235 AddEncoding x-compress Z236 AddEncoding x-gzip gz tgz237 221 238 222 AddLanguage da .dk … … 259 243 LanguagePriority en da nl et fr de el it ja pl pt pt-br ltz ca es sv 260 244 </IfModule> 261 262 AddType application/x-tar .tgz263 AddType image/bmp .bmp264 265 AddType text/x-hdml .hdml266 245 </IfModule> 267 246 … … 318 297 Listen 443 319 298 Listen 444 320 321 AddType application/x-x509-ca-cert .crt322 AddType application/x-pkcs7-crl .crl323 299 324 300 # This directive allows insecure renegotiations to succeed for browsers
Note: See TracChangeset
for help on using the changeset viewer.