Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with supporting Cyrillic alphabet #46

Open
AIHI opened this issue Apr 14, 2023 · 5 comments
Open

Problems with supporting Cyrillic alphabet #46

AIHI opened this issue Apr 14, 2023 · 5 comments

Comments

@AIHI
Copy link

AIHI commented Apr 14, 2023

According to my observations, if the Cyrillic alphabet has more than 42-43 characters, the library starts to work incorrectly

Video

@dougwilson
Copy link
Contributor

Hello, and thank you for your report. Can you help by providing a reproduction of the issue you are referring to? Just paste the code in here that shows the usage of this module and also please show what you are expecting the output to look like. Thank you!

@AIHI
Copy link
Author

AIHI commented Apr 14, 2023

Hello!
Thank you for your quick reaction to my question.

res.setHeader( 'Content-Disposition', contentDisposition("Приказ.Минобрнауки.2009г.Об.утвержденииф.pdf", { type: 'attachment', }) )

Video: 01:40 - 01:46
Expect to receive this file name when downloading:
Приказ.Минобрнауки.2009г.Об.утвержденииф.pdf

And we get this
6438b5fbbca27100219cc149

@dougwilson
Copy link
Contributor

Sorry for your trouble. What web browser is this happening in? As far as I can tell, the content-disposition header generated is following RFC 6266. Besides the web browser so I can reproduce the issue, do you have an example of what the content-disposition header you are expecting to see it?

Here is what this module outputs for your given input. It seems unclear where exactly 6438b5fbbca27100219cc149 would come from.

> contentDisposition("Приказ.Минобрнауки.2009г.Об.утвержденииф.pdf", { type: 'attachment', })
`attachment; filename="??????.???????????.2009?.??.????????????.pdf"; filename*=UTF-8''%D0%9F%D1%80%D0%B8%D0%BA%D0%B0%D0
%B7.%D0%9C%D0%B8%D0%BD%D0%BE%D0%B1%D1%80%D0%BD%D0%B0%D1%83%D0%BA%D0%B8.2009%D0%B3.%D0%9E%D0%B1.%D1%83%D1%82%D0%B2%D0%B5%
D1%80%D0%B6%D0%B4%D0%B5%D0%BD%D0%B8%D0%B8%D1%84.pdf`

@AIHI
Copy link
Author

AIHI commented Apr 14, 2023

In this example I use Safari v.16.4.1 (17615.1.26.101.10, 17615)

6438b5fbbca27100219cc149 — this id in MongoDB

The file is received by the link of the
/api/some_path/6438b5fbbca27100219cc149

@dougwilson
Copy link
Contributor

Thank you. Unfortunately I don't have access to Safari. If you or something can see what is wrong, you are welcome to make a pull request to fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants