forscht / ddrive

Discord as a filesystem.
https://ddrive.forscht.dev
MIT License
491 stars 98 forks source link

Can not download files which has Unicode characters in filename. #74

Closed MeowIce closed 1 year ago

MeowIce commented 1 year ago

When I try to download a file with Unicode characters in its filename, for example: ă à ạ ã.zip, it returns an invalid character set error. image Logs:

{"level":50,"time":1679326699626,"err":{"type":"TypeError","message":"Invalid character in header content [\"Content-Disposition\"]","stack":"TypeError [ERR_INVALID_CHAR]: Invalid character in header content [\"Content-Disposition\"]\n    at storeHeader (node:_http_outgoing:532:5)\n    at processHeader (node:_http_outgoing:527:3)\n    at ServerResponse._storeHeader (node:_http_outgoing:421:11)\n    at ServerResponse.writeHead (node:_http_server:369:8)\n    at module.exports.handler (/home/meowice/Downloads/ddrive/src/http/api/routes/file/download.js:75:15)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)","code":"ERR_INVALID_CHAR","reqId":"req-x"},"msg":"Invalid character in header content [\"Content-Disposition\"]"}
{"level":30
forscht commented 1 year ago

@MeowIce Can you take pull and try again?

MeowIce commented 1 year ago

@MeowIce Can you take pull and try again?

Yes, it can download now but the filename has removed all Unicode chars. Can you keep those chars ? Filename on DDrive: ă à ạ ã ả hảy Filename after downloaded: hy

forscht commented 1 year ago

@MeowIce Take pull and try again

MeowIce commented 1 year ago

@MeowIce Take pull and try again

Worked ;) Thanks for your quick reply and fixes <3