On 07/14/2016 08:47 PM, Jan-Tarek Butt wrote:
Hi,
This patch fix the autoupdater url error message. If the mirror url inside the site.conf ends with "/". The autoupdater will add additionally a "/" without checking. This patch add a check of endig urls.
What webservers actually have problems with double slashes? I've tested with Nginx, which doesn't care.
admin/autoupdater/files/usr/sbin/autoupdater | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/admin/autoupdater/files/usr/sbin/autoupdater b/admin/autoupdater/files/usr/sbin/autoupdater index be3e393..716fce4 100755 --- a/admin/autoupdater/files/usr/sbin/autoupdater +++ b/admin/autoupdater/files/usr/sbin/autoupdater @@ -188,9 +188,15 @@ local function read_manifest(mirror) return ret end +function string.ends(String,End)
- return End=='' or string.sub(String,-string.len(End))==End
+end -- Downloads the firmware image from a mirror to a given output file local function fetch_firmware(mirror, filename, output)
- if string.ends(mirror, "/") then
- mirror = string.sub(mirror,1,-2)
- end if autoupdater_util.exec('wget', '-T', '120', '-O', output, mirror .. '/' .. filename) ~= 0 then io.stderr:write('Error downloading the image from ' .. mirror .. '\n') return false