Skip to content

Commit

Permalink
fix: encoding filename in Content-Disposition header (#1596)
Browse files Browse the repository at this point in the history
Co-authored-by: Nagy Viktor <[email protected]>
  • Loading branch information
hashtagnulla and hashtagnulla authored Feb 19, 2024
1 parent e194979 commit 5d82b93
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 5d82b93

Please sign in to comment.