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

feat: make Playground HTML content compatible with UTF-8 charset #2355

Merged
merged 1 commit into from
Sep 6, 2022
Merged

feat: make Playground HTML content compatible with UTF-8 charset #2355

merged 1 commit into from
Sep 6, 2022

Conversation

nekomeowww
Copy link
Contributor

@nekomeowww nekomeowww commented Sep 6, 2022

summary

The current Playground page content and Playground server doesn't compatible with UTF-8 charset. This may result in string corruption and page content unusable if the developers would try to use UTF-8 strings/contents in their schemas or Playground title.

The compatible has been done by:

  • Completing the Content-Type header with text/html; charset=UTF-8
  • Adding <meta charset="utf-8"> in <head> section and before <title> element

In most of the usage scenarios, the Playground would be configured to be deployed behind a gateway or reverse proxy, so I added the UTF-8 support for both Content-Type header and template to prevent the mis-configuration of gateway or reverse proxy where it may cause the HTML parser got lost to find out the encoding of the content on the browser side.

references

Related to: #2354

I have:

  • Added tests covering the bug / feature (see testing)
  • Updated any relevant documentation (see docs) (not needed for this PR)

@coveralls
Copy link

Coverage Status

Coverage remained the same at 75.437% when pulling 6a3b111 on nekomeowww:dev/fix-playground-title-utf8-issue into 182b039 on 99designs:master.

@StevenACoffman StevenACoffman merged commit 56574a1 into 99designs:master Sep 6, 2022
@StevenACoffman
Copy link
Collaborator

Thanks! Nice catch!

@nekomeowww nekomeowww deleted the dev/fix-playground-title-utf8-issue branch September 6, 2022 13:01
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.

None yet

3 participants