From 4750648ca68e97469dcbcd1fba84c82708a80b09 Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Thu, 10 Dec 2009 16:27:17 +0500 Subject: mod_httpserver: Read files in binary mode; fixes issues with serving binary files. --- plugins/mod_httpserver.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/mod_httpserver.lua b/plugins/mod_httpserver.lua index 24247596..7135f479 100644 --- a/plugins/mod_httpserver.lua +++ b/plugins/mod_httpserver.lua @@ -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(); -- cgit v1.2.3