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

set charset in the Content-Type header for chunked responses #938

Merged
merged 1 commit into from
May 23, 2018
Merged

set charset in the Content-Type header for chunked responses #938

merged 1 commit into from
May 23, 2018

Conversation

gregor-rayman
Copy link

Chunked plain text reponses would not include the charset part of the Content-Type header.

  val dummy: Endpoint[AsyncStream[String]] = get("dummy"){
    Ok( AsyncStream.of("Hello / Привет")).withCharset(StandardCharsets.UTF_8)
  }

The response of this endpoint would be correctly encoded in UTF-8, but the browsers would interpret it wrongly becuase of the missing charset part in the response header.

@codecov-io
Copy link

Codecov Report

Merging #938 into master will decrease coverage by 0.52%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #938      +/-   ##
==========================================
- Coverage   83.05%   82.52%   -0.53%     
==========================================
  Files          51       51              
  Lines         767      767              
  Branches       40       34       -6     
==========================================
- Hits          637      633       -4     
- Misses        130      134       +4
Impacted Files Coverage Δ
core/src/main/scala/io/finch/Output.scala 94.73% <100%> (ø) ⬆️
core/src/main/scala/io/finch/Input.scala 87.5% <0%> (-12.5%) ⬇️
core/src/main/scala/io/finch/ToResponse.scala 96.77% <0%> (+3.22%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 45bd5b7...4321be6. Read the comment docs.

@vkostyukov
Copy link
Collaborator

Looks great! Thank you, @gregor-rayman!

@vkostyukov vkostyukov merged commit 61293f0 into finagle:master May 23, 2018
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