Browse Source

url decode

master
e 5 years ago
parent
commit
e4c39bfcfa
1 changed files with 10 additions and 2 deletions
  1. +10
    -2
      routers/repo/dataset.go

+ 10
- 2
routers/repo/dataset.go View File

@@ -2,6 +2,7 @@ package repo


import ( import (
"code.gitea.io/gitea/modules/storage" "code.gitea.io/gitea/modules/storage"
"net/url"
"sort" "sort"


"code.gitea.io/gitea/models" "code.gitea.io/gitea/models"
@@ -81,12 +82,19 @@ func DatasetIndex(ctx *context.Context) {
ctx.Data["Attachments"] = attachments ctx.Data["Attachments"] = attachments
ctx.Data["IsOwner"] = true ctx.Data["IsOwner"] = true
uuid := gouuid.NewV4().String() 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 { if err != nil {
ctx.ServerError("PresignedPutURL", err) 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["uuid"] = uuid
ctx.Data["url"] = url
ctx.Data["url"] = preUrl
renderAttachmentSettings(ctx) renderAttachmentSettings(ctx)


ctx.HTML(200, tplIndex) ctx.HTML(200, tplIndex)


Loading…
Cancel
Save