S3 API File Uploads #1
|
@ -155,7 +155,7 @@ func (h *Handler) fetch(resp http.ResponseWriter, req *http.Request) {
|
|||
}
|
||||
|
||||
if h.Cdn != "" {
|
||||
resp.Header().Set("Location", h.Cdn + "/" + filename)
|
||||
resp.Header().Set("Location", h.Cdn+"/"+filename)
|
||||
resp.WriteHeader(http.StatusCreated)
|
||||
return
|
||||
}
|
||||
|
@ -293,7 +293,7 @@ func (h *Handler) store(resp http.ResponseWriter, req *http.Request) {
|
|||
}
|
||||
|
||||
if h.Cdn != "" {
|
||||
resp.Header().Set("Location", h.Cdn + "/" + outFilename)
|
||||
resp.Header().Set("Location", h.Cdn+"/"+outFilename)
|
||||
} else {
|
||||
resp.Header().Set("Location", "/uploads/"+outFilename)
|
||||
}
|
||||
|
|
|
@ -8,8 +8,8 @@ import (
|
|||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/aws/aws-sdk-go-v2/config"
|
||||
"github.com/aws/aws-sdk-go-v2/aws"
|
||||
"github.com/aws/aws-sdk-go-v2/config"
|
||||
awss3 "github.com/aws/aws-sdk-go-v2/service/s3"
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue