v0.0.27.1 Добавлены заголовки cors при формировании временной ссылки s3
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
ef9bb2c484
commit
64f5e7a55f
@ -76,6 +76,9 @@ func GeneratePresignedUploadURL(userID int, filename string) (string, string, er
|
||||
ContentLength: aws.Int64(10 * 1024 * 1024), // Макс 10MB
|
||||
})
|
||||
|
||||
req.HTTPRequest.Header.Set("Access-Control-Allow-Origin", "https://tailly.ru")
|
||||
req.HTTPRequest.Header.Set("Access-Control-Allow-Methods", "PUT, OPTIONS")
|
||||
req.HTTPRequest.Header.Set("Access-Control-Allow-Headers", "Content-Type, Content-Length, Authorization, x-amz-date")
|
||||
// URL действителен 15 минут
|
||||
url, err := req.Presign(15 * time.Minute)
|
||||
if err != nil {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user