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

[3.x] fix content-length for the String constructor #4683

Merged
merged 2 commits into from
Feb 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -319,10 +319,11 @@ class CodegenTest {

val targetLanguage = if (generateKotlinModels) KOTLIN_1_5 else JAVA
val targetLanguagePath = if (generateKotlinModels) "kotlin" else "java"
@Suppress("DEPRECATION")
val flattenModels = when {
folder.name in listOf("capitalized_fields", "companion") -> true
targetLanguage == JAVA -> true
else -> false
else -> codegenModels == MODELS_COMPAT
}
val customScalarsMapping = if (folder.name in listOf(
"custom_scalar_type",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ constructor(
) : this(
statusCode = statusCode,
body = flowOf(body.encodeUtf8()),
headers = headers + mapOf("Content-Length" to body.length.toString()),
headers = headers + mapOf("Content-Length" to body.encodeUtf8().size.toString()),
delayMillis = delayMillis,
)

Expand Down