Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/torch/luajit-rocks.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/luarocks/upload/multipart.lua')
-rw-r--r--src/luarocks/upload/multipart.lua5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/luarocks/upload/multipart.lua b/src/luarocks/upload/multipart.lua
index 5677657..aad2e43 100644
--- a/src/luarocks/upload/multipart.lua
+++ b/src/luarocks/upload/multipart.lua
@@ -19,15 +19,14 @@ function File:mime()
local mimetypes_ok, mimetypes = pcall(require, "mimetypes")
if mimetypes_ok then
self.mimetype = mimetypes.guess(self.fname)
- else
- self.mimetype = "application/octet-stream"
end
+ self.mimetype = self.mimetype or "application/octet-stream"
end
return self.mimetype
end
function File:content()
- local fd = io.open(self.fname)
+ local fd = io.open(self.fname, "rb")
if not fd then
return nil, "Failed to open file: "..self.fname
end