From 9325419002afa328177c4343700360d5cde209ff Mon Sep 17 00:00:00 2001 From: Pierre-Olivier Mercier Date: Fri, 24 Nov 2017 19:34:14 +0100 Subject: [PATCH] import: avoid ugly padding = at the end of base32 pathname --- admin/api/file.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin/api/file.go b/admin/api/file.go index 28a4e4a4..e82b2cca 100644 --- a/admin/api/file.go +++ b/admin/api/file.go @@ -89,7 +89,7 @@ func importFile(uf uploadedFile, next func(string, string, []byte) (interface{}, return nil, errors.New("URI or path not filled") } - pathname := path.Join(fic.FilesDir, strings.ToLower(base32.StdEncoding.EncodeToString(hash[:])), path.Base(fromURI)) + pathname := path.Join(fic.FilesDir, strings.ToLower(base32.StdEncoding.WithPadding(0).EncodeToString(hash[:])), path.Base(fromURI)) // Remove the file if it exists // TODO: check if this is symlink => remove to avoid File not found error after, because the file is writen at the adresse pointed.