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

KTOR-7876 Fix Sink.writeText corrupts long streams for Jetty server #4526

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

Conversation

marychatte
Copy link
Member

@marychatte marychatte requested a review from e5l December 4, 2024 14:14
@@ -89,18 +89,14 @@ public fun Source.readTextExactCharacters(charactersCount: Int, charset: Charset
}

/**
* Writes [text] characters in range \[[fromIndex] .. [toIndex]) with the specified [charset]
* Writes [text] characters in range [fromIndex] .. [toIndex]) with the specified [charset]
Copy link
Member

Choose a reason for hiding this comment

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

Could you check the KDoc and mention explicitly included and excluded part of the ranges?

*/
public fun Sink.writeText(
text: CharSequence,
fromIndex: Int = 0,
toIndex: Int = text.length,
charset: Charset = Charsets.UTF_8
) {
if (charset === Charsets.UTF_8) {
return writeString(text.toString(), fromIndex, toIndex)
Copy link
Member

Choose a reason for hiding this comment

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

Could you tell me why whiteStrings corrupts non ASCII? Should we log this to the kotlinx-io instead?

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