You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axkit-dev@xml.apache.org by ma...@sergeant.org on 2006/08/09 04:50:06 UTC
[SVN] [64] Use new mime_type method
Revision: 64
Author: matt
Date: 2006-08-09 02:49:43 +0000 (Wed, 09 Aug 2006)
Log Message:
-----------
Use new mime_type method
Modified Paths:
--------------
trunk/plugins/serve_file
Modified: trunk/plugins/serve_file
===================================================================
--- trunk/plugins/serve_file 2006-08-09 02:38:11 UTC (rev 63)
+++ trunk/plugins/serve_file 2006-08-09 02:49:43 UTC (rev 64)
@@ -4,6 +4,8 @@
sub hook_response {
my ($self, $hd) = @_;
+ my $ct = $hd->mime_type;
+
if ($hd->request_method eq 'GET' || $hd->request_method eq 'HEAD') {
# and once we have it, start serving
$self->client->watch_read(0);
@@ -13,13 +15,14 @@
$self->client->write("HTTP/1.1 200 OK
Date: Mon, 24 Jul 2006 23:59:39 GMT
Server: Apache/1.3.33 (Darwin)
-Content-Type: text/html
+Content-Type: $ct
");
local $/;
$self->client->write(<$fh>);
}
else {
+ # this should be a 404, probably
$self->client->write("HTTP/1.1 200 OK
Date: Mon, 24 Jul 2006 23:59:39 GMT
Server: Apache/1.3.33 (Darwin)
@@ -35,4 +38,4 @@
}
return DECLINED;
-}
\ No newline at end of file
+}