Merge pull request #5732 from anyuta1166/5731
luci-app-openvpn: fix openvpn config corruption on upload
This commit is contained in:
commit
3968f80c3c
2 changed files with 2 additions and 3 deletions
|
@ -31,8 +31,7 @@ function ovpn_upload()
|
|||
|
||||
http.setfilehandler(
|
||||
function(meta, chunk, eof)
|
||||
local data = util.trim(chunk:gsub("\r\n", "\n")) .. "\n"
|
||||
data = util.trim(data:gsub("[\128-\255]", ""))
|
||||
local data = chunk:gsub("\r\n", "\n")
|
||||
|
||||
if not fp and meta and meta.name == "ovpn_file" then
|
||||
fp = io.open(file, "w")
|
||||
|
|
|
@ -51,7 +51,7 @@ function file.cfgvalue()
|
|||
end
|
||||
|
||||
function file.write(self, section, data1)
|
||||
return fs.writefile(cfg_file, "\n" .. util.trim(data1:gsub("\r\n", "\n")) .. "\n")
|
||||
return fs.writefile(cfg_file, util.trim(data1:gsub("\r\n", "\n")) .. "\n")
|
||||
end
|
||||
|
||||
function file.remove(self, section, value)
|
||||
|
|
Loading…
Reference in a new issue