diff --git a/ktor-http/ktor-http-cio/common/src/io/ktor/http/cio/HttpParser.kt b/ktor-http/ktor-http-cio/common/src/io/ktor/http/cio/HttpParser.kt index 045f3f9a81..0104b15d5d 100644 --- a/ktor-http/ktor-http-cio/common/src/io/ktor/http/cio/HttpParser.kt +++ b/ktor-http/ktor-http-cio/common/src/io/ktor/http/cio/HttpParser.kt @@ -1,6 +1,6 @@ /* -* Copyright 2014-2021 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. -*/ + * Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license. + */ package io.ktor.http.cio @@ -31,7 +31,7 @@ public suspend fun parseRequest(input: ByteReadChannel): Request? { try { while (true) { - if (!input.readUTF8LineTo(builder, HTTP_LINE_LIMIT)) return null + if (!input.readUTF8LineTo(builder, HTTP_LINE_LIMIT, LineEndingMode.HttpLineEndings)) return null range.end = builder.length if (range.start == range.end) continue @@ -66,7 +66,7 @@ public suspend fun parseResponse(input: ByteReadChannel): Response? { val range = MutableRange(0, 0) try { - if (!input.readUTF8LineTo(builder, HTTP_LINE_LIMIT)) return null + if (!input.readUTF8LineTo(builder, HTTP_LINE_LIMIT, LineEndingMode.HttpLineEndings)) return null range.end = builder.length val version = parseVersion(builder, range) @@ -106,7 +106,7 @@ internal suspend fun parseHeaders( try { while (true) { - if (!input.readUTF8LineTo(builder, HTTP_LINE_LIMIT)) { + if (!input.readUTF8LineTo(builder, HTTP_LINE_LIMIT, LineEndingMode.HttpLineEndings)) { headers.release() return null }