mod_httpserver: Read files in binary mode; fixes issues with serving binary files.
[prosody.git] / 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();