Skip to content

Add default utf-8 charset to node file responses #4486

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

arekmaz
Copy link
Contributor

@arekmaz arekmaz commented Feb 20, 2025

Type

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update

Description

I noticed that by default the node platform HttpServerResponse.file sets just e.g. "text/html" as the content type, which prevents e.g. some browsers from displaying emojis correctly.

To be clear specification doesn't specify any behavior.

As per chatgpt, we should be able to safely add a default charset attribute with any content type coming from the "mime" package, the client should just ignore it in case of non-textual responses.

This is my proposition to correct this problem.

Related

  • Related Issue #
  • Closes #

@arekmaz arekmaz requested a review from tim-smart as a code owner February 20, 2025 21:11
Copy link

changeset-bot bot commented Feb 20, 2025

🦋 Changeset detected

Latest commit: 1d07549

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 22 packages
Name Type
@effect/platform-node Patch
@effect/cluster-node Patch
@effect/cluster-workflow Patch
@effect/cluster Patch
@effect/experimental Patch
@effect/sql-clickhouse Patch
@effect/ai-anthropic Patch
@effect/ai-openai Patch
@effect/sql-d1 Patch
@effect/sql-libsql Patch
@effect/sql-mssql Patch
@effect/sql-mysql2 Patch
@effect/sql-pg Patch
@effect/sql-sqlite-bun Patch
@effect/sql-sqlite-do Patch
@effect/sql-sqlite-node Patch
@effect/sql-sqlite-react-native Patch
@effect/sql-sqlite-wasm Patch
@effect/sql Patch
@effect/ai Patch
@effect/sql-drizzle Patch
@effect/sql-kysely Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

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

Successfully merging this pull request may close these issues.

1 participant