diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2024-06-24 11:14:14 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-24 11:14:14 -0300 |
commit | f87568a7cba69e2c19411e7a2b73016c80a14a3b (patch) | |
tree | 51a6e1d2bca47a45dc65e87dd5f0b7c56c6c100d | |
parent | e403815e5af5f95f1fa5bfdfc178e025e1103ba4 (diff) | |
download | luarocks-f87568a7cba69e2c19411e7a2b73016c80a14a3b.tar.gz luarocks-f87568a7cba69e2c19411e7a2b73016c80a14a3b.tar.bz2 luarocks-f87568a7cba69e2c19411e7a2b73016c80a14a3b.zip |
fix: multipart: accept Windows-style paths (#1689)
Fixes #1687.
-rw-r--r-- | src/luarocks/upload/multipart.lua | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/luarocks/upload/multipart.lua b/src/luarocks/upload/multipart.lua index 56ae873e..790e368f 100644 --- a/src/luarocks/upload/multipart.lua +++ b/src/luarocks/upload/multipart.lua | |||
@@ -70,7 +70,7 @@ function multipart.encode(params) | |||
70 | local buffer = { 'Content-Disposition: form-data; name="' .. k .. '"' } | 70 | local buffer = { 'Content-Disposition: form-data; name="' .. k .. '"' } |
71 | local content | 71 | local content |
72 | if type(v) == "table" and v.__class == File then | 72 | if type(v) == "table" and v.__class == File then |
73 | buffer[1] = buffer[1] .. ('; filename="' .. v.fname:gsub(".*/", "") .. '"') | 73 | buffer[1] = buffer[1] .. ('; filename="' .. v.fname:gsub(".*[/\\]", "") .. '"') |
74 | table.insert(buffer, "Content-type: " .. v:mime()) | 74 | table.insert(buffer, "Content-type: " .. v:mime()) |
75 | content = v:content() | 75 | content = v:content() |
76 | else | 76 | else |