Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

B-21937: Allow Doc Uploads/Downloads with Commas #14509

Merged
merged 7 commits into from
Jan 6, 2025
5 changes: 4 additions & 1 deletion pkg/storage/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"io"
"path"
"strconv"
"time"

"github.com/aws/aws-sdk-go-v2/aws"
Expand Down Expand Up @@ -116,9 +117,11 @@ func (s *S3) TempFileSystem() *afero.Afero {
func (s *S3) PresignedURL(key string, contentType string, filename string) (string, error) {
namespacedKey := path.Join(s.keyNamespace, key)
presignClient := s3.NewPresignClient(s.client)
// Double quote the filename to be able to handle filenames with commas in them
quotedFilename := strconv.Quote(filename)
brianmanley-caci marked this conversation as resolved.
Show resolved Hide resolved

filenameBuffer := make([]byte, 0)
for _, r := range filename {
for _, r := range quotedFilename {
if encodedRune, ok := charmap.ISO8859_1.EncodeRune(r); ok {
filenameBuffer = append(filenameBuffer, encodedRune)
}
Expand Down
Loading