mod_httpserver: Read files in binary mode; fixes issues with serving binary files.
authorWaqas Hussain <waqas20@gmail.com>
Thu, 10 Dec 2009 11:27:17 +0000 (16:27 +0500)
committerWaqas Hussain <waqas20@gmail.com>
Thu, 10 Dec 2009 11:27:17 +0000 (16:27 +0500)
plugins/mod_httpserver.lua

index 08328a43069328a936d1ed1498768ebcd5e3362f..426bbf2c548a1ea54564f09a12b4a670bfc173e0 100644 (file)
@@ -47,7 +47,7 @@ local function preprocess_path(path)
 end
 
 function serve_file(path)
-       local f, err = open(http_base..path, "r");
+       local f, err = open(http_base..path, "rb");
        if not f then return response_404; end
        local data = f:read("*a");
        f:close();