-/* $Id: httpd.js,v 1.15 2005/07/06 23:52:23 mmondor Exp $ */
+/* $Id: httpd.js,v 1.16 2005/07/06 23:53:54 mmondor Exp $ */
/*
* Copyright (c) 2005, Matthew Mondor
* priority at current time.
*
* TODO:
- * - We probably want to support proxy/cache queries that request if a
- * document was modified, which would be ideal for static files, but
- * would always return modified status for dynamic data.
- * A query which has a field such as:
- * ...
- * If-Modified-Since: Sat, 02 Oct 2004 10:52:44 GMT
- * Could receive a response such as:
- * HTTP/1.1 304 Not Modified
- * Date: Mon, 04 Jul 2005 22:45:37 GMT
- * Server: Apache/1.3.33 (Unix) mod_ssl/2.8.21 OpenSSL/0.9.7d
- * Connection: close
* - See what to do for HEAD and PUT
* - Think about how I'll handle invokation of scripts. I'll most probably
* need to eval() them initially and cache them once evaluated, until
* Server identification
*/
SERVER_VERSION = 'mmondor_js_httpd/0.0.1 (NetBSD)';
-SERVER_CVSID = '$Id: httpd.js,v 1.15 2005/07/06 23:52:23 mmondor Exp $';
+SERVER_CVSID = '$Id: httpd.js,v 1.16 2005/07/06 23:53:54 mmondor Exp $';
-/* $Id: options.js,v 1.3 2005/07/06 20:33:28 mmondor Exp $ */
+/* $Id: options.js,v 1.4 2005/07/06 23:52:23 mmondor Exp $ */
var options = {
/* Maximum number of concurrent clients that we should serve */
/* Size of I/O buffer to transfer file/data blocks */
readbuf_size: 16384,
/* Default virtual host site to use */
- default_vhost: "hal.xisop"
+ default_vhost: "hal.xisop",
+ /* Default mimetype to use when none matching file extension */
+ default_mimetype: "application/octet-stream"
};
/* Address:port combinations to listen to */
scripts: false
}
];
+
+var mimetypes = {
+ 'text/html; charset=iso-8859-1': [ "html", "htm", "dhtml" ],
+ 'text/plain; charset=iso-8859-1': [ "txt" ],
+ 'text/css': [ "css" ],
+ 'application/pdf': [ "pdf" ],
+ 'application/postscript': [ "ps" ],
+ 'applicatoin/x-tar': [ "tar" ],
+ 'application/x-gzip': [ "gz" ],
+ 'applicatoin/x-bzip2': [ "bz2" ],
+ 'application/zip': [ "zip" ],
+ 'application/x-javascript': [ "js" ],
+ 'application/x-sh': [ "sh" ],
+ 'application/x-shockwave-flash': [ "swf" ],
+ 'application/xml': [ "xml" ],
+ 'application/xml-dtd': [ "dtd" ],
+ 'image/jpg': [ "jpg", "jpeg" ],
+ 'image/png': [ "png" ],
+ 'image/gif': [ "gif" ],
+ 'image/x-icon': [ "ico" ],
+ 'video/mpeg': [ "mpeg", "mpg" ],
+ 'video/quicktime': [ "mov" ],
+ 'video/x-msvideo': [ "asf", "asx", "wmv", "avi" ]
+};