@@ -304,6 +304,7 @@ func (s EvidenceService) GenerateFileURL(
|
|||||||
presignedReq, err := presignClient.PresignGetObject(ctx, &s3.GetObjectInput{
|
presignedReq, err := presignClient.PresignGetObject(ctx, &s3.GetObjectInput{
|
||||||
Bucket: aws.String(s.svc.bucket),
|
Bucket: aws.String(s.svc.bucket),
|
||||||
Key: aws.String(evidence.ObjectKey),
|
Key: aws.String(evidence.ObjectKey),
|
||||||
|
ResponseCacheControl: aws.String("max-age=3600, public"),
|
||||||
ResponseContentType: aws.String(evidence.MimeType),
|
ResponseContentType: aws.String(evidence.MimeType),
|
||||||
ResponseContentDisposition: aws.String(contentDisposition),
|
ResponseContentDisposition: aws.String(contentDisposition),
|
||||||
}, func(opts *s3.PresignOptions) {
|
}, func(opts *s3.PresignOptions) {
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
|
"net/url"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/aws/aws-sdk-go-v2/aws"
|
"github.com/aws/aws-sdk-go-v2/aws"
|
||||||
@@ -174,9 +175,15 @@ func (s OrganizationService) GenerateLogoURL(
|
|||||||
|
|
||||||
presignClient := s3.NewPresignClient(s.svc.s3)
|
presignClient := s3.NewPresignClient(s.svc.s3)
|
||||||
|
|
||||||
|
encodedFilename := url.QueryEscape(organization.Name)
|
||||||
|
contentDisposition := fmt.Sprintf("attachment; filename=\"%s\"; filename*=UTF-8''%s",
|
||||||
|
encodedFilename, encodedFilename)
|
||||||
|
|
||||||
presignedReq, err := presignClient.PresignGetObject(ctx, &s3.GetObjectInput{
|
presignedReq, err := presignClient.PresignGetObject(ctx, &s3.GetObjectInput{
|
||||||
Bucket: aws.String(s.svc.bucket),
|
Bucket: aws.String(s.svc.bucket),
|
||||||
Key: aws.String(organization.LogoObjectKey),
|
Key: aws.String(organization.LogoObjectKey),
|
||||||
|
ResponseCacheControl: aws.String("max-age=3600, public"),
|
||||||
|
ResponseContentDisposition: aws.String(contentDisposition),
|
||||||
}, func(opts *s3.PresignOptions) {
|
}, func(opts *s3.PresignOptions) {
|
||||||
opts.Expires = expiresIn
|
opts.Expires = expiresIn
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -169,6 +169,7 @@ func (s VendorComplianceReportService) GenerateFileURL(
|
|||||||
presignedReq, err := presignClient.PresignGetObject(ctx, &s3.GetObjectInput{
|
presignedReq, err := presignClient.PresignGetObject(ctx, &s3.GetObjectInput{
|
||||||
Bucket: aws.String(s.svc.bucket),
|
Bucket: aws.String(s.svc.bucket),
|
||||||
Key: aws.String(vendorComplianceReport.FileKey),
|
Key: aws.String(vendorComplianceReport.FileKey),
|
||||||
|
ResponseCacheControl: aws.String("max-age=3600, public"),
|
||||||
ResponseContentDisposition: aws.String(contentDisposition),
|
ResponseContentDisposition: aws.String(contentDisposition),
|
||||||
}, func(opts *s3.PresignOptions) {
|
}, func(opts *s3.PresignOptions) {
|
||||||
opts.Expires = expiresIn
|
opts.Expires = expiresIn
|
||||||
|
|||||||
Reference in New Issue
Block a user