From e4c39bfcfa35e66966c9af234f4190c7477f1f6f Mon Sep 17 00:00:00 2001 From: e <747342561@qq.com> Date: Thu, 4 Jun 2020 16:31:44 +0800 Subject: [PATCH] url decode --- routers/repo/dataset.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/routers/repo/dataset.go b/routers/repo/dataset.go index 47a425c84..e8c64ad02 100644 --- a/routers/repo/dataset.go +++ b/routers/repo/dataset.go @@ -2,6 +2,7 @@ package repo import ( "code.gitea.io/gitea/modules/storage" + "net/url" "sort" "code.gitea.io/gitea/models" @@ -81,12 +82,19 @@ func DatasetIndex(ctx *context.Context) { ctx.Data["Attachments"] = attachments ctx.Data["IsOwner"] = true uuid := gouuid.NewV4().String() - url, err := storage.Attachments.PresignedPutURL(models.AttachmentRelativePath(uuid)) + log.Info(uuid) + tmpUrl, err := storage.Attachments.PresignedPutURL(models.AttachmentRelativePath(uuid)) if err != nil { ctx.ServerError("PresignedPutURL", err) } + log.Info(tmpUrl) + preUrl,err := url.QueryUnescape(tmpUrl) + if err != nil { + ctx.ServerError("QueryUnescape", err) + } + log.Info(preUrl) ctx.Data["uuid"] = uuid - ctx.Data["url"] = url + ctx.Data["url"] = preUrl renderAttachmentSettings(ctx) ctx.HTML(200, tplIndex)