@@ -135,27 +135,6 @@ export class S3Store extends DataStore {
135135 return this . cache . get ( id ) as MetadataValue
136136 }
137137
138- /**
139- * Parses the Base64 encoded metadata received from the client.
140- */
141- private parseMetadataString ( str ?: string ) {
142- const pairs : Record < string , { encoded : string ; decoded ?: string } > = { }
143-
144- if ( ! str ) {
145- return pairs
146- }
147-
148- for ( const pair of str . split ( ',' ) ) {
149- const [ key , encoded ] = pair . split ( ' ' )
150- pairs [ key ] = {
151- encoded,
152- decoded : encoded ? Buffer . from ( encoded , 'base64' ) . toString ( 'ascii' ) : undefined ,
153- }
154- }
155-
156- return pairs
157- }
158-
159138 private partKey ( id : string , isIncomplete = false ) {
160139 if ( isIncomplete ) {
161140 id += '.part'
@@ -412,7 +391,6 @@ export class S3Store extends DataStore {
412391 */
413392 public async create ( upload : Upload ) {
414393 log ( `[${ upload . id } ] initializing multipart upload` )
415- const parsedMetadata = this . parseMetadataString ( upload . metadata )
416394 type CreateRequest = Omit < aws . S3 . Types . CreateMultipartUploadRequest , 'Metadata' > & {
417395 Metadata : Record < string , string >
418396 }
@@ -430,16 +408,8 @@ export class S3Store extends DataStore {
430408 file . isSizeDeferred = 'true'
431409 }
432410
433- if ( upload . metadata !== undefined ) {
434- file . metadata = upload . metadata
435- }
436-
437- if ( parsedMetadata . contentType ) {
438- request . ContentType = parsedMetadata . contentType . decoded
439- }
440-
441- if ( parsedMetadata . filename ) {
442- request . Metadata . original_name = parsedMetadata . filename . encoded
411+ if ( upload . metadata ?. contentType ) {
412+ request . ContentType = upload . metadata . contentType
443413 }
444414
445415 // TODO: rename `file` to `upload` to align with the codebase
0 commit comments