Skip to content

Commit

Permalink
fix: encoding filename in Content-Disposition header
Browse files Browse the repository at this point in the history
  • Loading branch information
hashtagnulla committed Feb 14, 2024
1 parent e194979 commit 6b1f420
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/sn-client-core/src/Repository/Upload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ export class Upload {
method: 'POST',
headers: {
'Content-Range': `bytes 0-${this.repository.configuration.chunkSize - 1}/${options.file.size}`,
'Content-Disposition': `attachment; filename="${options.file.name}"`,
'Content-Disposition': `attachment; filename="${encodeURIComponent(options.file.name)}"`,
},
})

Expand All @@ -200,7 +200,7 @@ export class Upload {
method: 'POST',
headers: {
'Content-Range': `bytes ${start}-${end - 1}/${options.file.size}`,
'Content-Disposition': `attachment; filename="${options.file.name}"`,
'Content-Disposition': `attachment; filename="${encodeURIComponent(options.file.name)}"`,
},
})
if (lastResponse.ok) {
Expand Down

0 comments on commit 6b1f420

Please sign in to comment.