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

fix: encoding issue in CDN responses #2130

Merged
merged 1 commit into from
Aug 18, 2022
Merged

fix: encoding issue in CDN responses #2130

merged 1 commit into from
Aug 18, 2022

Conversation

bparmentier
Copy link
Contributor

What/Why/How?

When downloading the redoc JS from redoc.ly CDN (e.g. https://cdn.redoc.ly/redoc/latest/bundles/redoc.standalone.js) the Content-Type header in the response is missing 'charset=utf-8', causing the file to be displayed with garbled characters.

I faced the issue in my project and found that it was indirectly reported multiple times over the years, as can be seen in #29.

The solution proposed in #213 (comment) is just a workaround and I'm actually not sure why it works for other people because according to https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta#attr-charset, "UTF-8 is the only valid encoding for HTML5 documents" anyway.

Reference

Testing

Open the above URL in a browser and search for e.g. .ellipsis:after. The value of content should be displayed as
image
instead of
image

When downloading the redoc JS from redoc.ly CDN (e.g.
https://cdn.redoc.ly/redoc/latest/bundles/redoc.standalone.js) the
Content-Type header in the response is missing 'charset=utf-8', causing
the file to be displayed with garbled characters.
@bparmentier bparmentier requested a review from a team as a code owner August 11, 2022 12:43
@bparmentier bparmentier requested review from AlexVarchuk and removed request for a team August 11, 2022 12:43
Copy link
Collaborator

@AlexVarchuk AlexVarchuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @bparmentier. Thank you a lot for your contribution 🙌

@AlexVarchuk AlexVarchuk merged commit 7816902 into Redocly:master Aug 18, 2022
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

Successfully merging this pull request may close these issues.

2 participants