Skip to content

Commit

Permalink
Merge pull request #70 from themost-framework/fix-content-file-name-e…
Browse files Browse the repository at this point in the history
…ncoding

Fix content file name encoding
  • Loading branch information
anthioikonomou authored Sep 12, 2023
2 parents 2d93dcb + a4c3547 commit eddfd36
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion modules/@themost/express/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion modules/@themost/express/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@themost/express",
"version": "1.6.1",
"version": "1.6.2",
"description": "MOST Data ORM Express Middleware",
"main": "dist/index.cjs.js",
"module": "dist/index.esm.js",
Expand Down
4 changes: 2 additions & 2 deletions modules/@themost/express/src/middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -1180,7 +1180,7 @@ function postEntitySetAction(options) {
bufferedStream = fs.createReadStream(file.path);
bufferedStream.contentEncoding = file.encoding;
bufferedStream.contentType = file.mimetype;
bufferedStream.contentFileName = file.originalname;
bufferedStream.contentFileName = Buffer.from(file.originalname, 'latin1').toString('utf-8');
bufferedStream.on('close', () => {
TraceUtils.debug(`(postEntitySetAction), Closing read stream, ${file.path}`);
try {
Expand Down Expand Up @@ -1547,7 +1547,7 @@ function postEntityAction(options) {
bufferedStream = fs.createReadStream(file.path);
bufferedStream.contentEncoding = file.encoding;
bufferedStream.contentType = file.mimetype;
bufferedStream.contentFileName = file.originalname;
bufferedStream.contentFileName = Buffer.from(file.originalname, 'latin1').toString('utf-8');
bufferedStream.on('close', () => {
TraceUtils.debug(`(postEntityAction), Closing read stream, ${file.path}`);
try {
Expand Down

0 comments on commit eddfd36

Please sign in to comment.