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 missing charset for static js, css and svg resources #4058

Conversation

marychatte
Copy link
Member

@marychatte marychatte commented May 30, 2024

Subsystem
Server, Static

Motivation
KTOR-6655

  1. application/javascript obsoleted in favor of text/javascript (https://www.iana.org/assignments/media-types/application/javascript)
  2. Add charset for svg, it's optional parameter (https://www.w3.org/TR/SVG/mimereg.html)

@marychatte marychatte self-assigned this May 30, 2024
@marychatte marychatte force-pushed the marychatte/KTOR-6655-static-js-css-and-svg-resources-misses-charset branch from d47f1e2 to 67276ce Compare June 12, 2024 19:29
@marychatte marychatte requested a review from bjhham June 13, 2024 09:21
Copy link
Contributor

@bjhham bjhham left a comment

Choose a reason for hiding this comment

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

👍

contentType.match(ContentType.Image.SVG) && contentType.charset() == null -> contentType.withCharset(
Charsets.UTF_8
)

Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like there's quite a few other text-based mime types hidden under "application/*", like xml, rss, soap. Could add them in while you're in the neighbourhood.

@marychatte marychatte force-pushed the marychatte/KTOR-6655-static-js-css-and-svg-resources-misses-charset branch from f697e22 to 4c2012e Compare June 14, 2024 12:02
@marychatte marychatte force-pushed the marychatte/KTOR-6655-static-js-css-and-svg-resources-misses-charset branch from 4c2012e to 1b1657f Compare June 17, 2024 10:17
@marychatte marychatte merged commit c892bc0 into main Jun 17, 2024
11 of 16 checks passed
@marychatte marychatte deleted the marychatte/KTOR-6655-static-js-css-and-svg-resources-misses-charset branch June 17, 2024 14:06
marychatte added a commit that referenced this pull request Jun 18, 2024
marychatte added a commit that referenced this pull request Jun 18, 2024
marychatte added a commit that referenced this pull request Jun 18, 2024
marychatte added a commit that referenced this pull request Jun 18, 2024
marychatte added a commit that referenced this pull request Jun 19, 2024
marychatte added a commit that referenced this pull request Jun 19, 2024
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