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

Request may not include Host parameter #1863

Closed
zuevmaxim opened this issue May 14, 2020 · 1 comment
Closed

Request may not include Host parameter #1863

zuevmaxim opened this issue May 14, 2020 · 1 comment
Assignees
Labels

Comments

@zuevmaxim
Copy link

zuevmaxim commented May 14, 2020

Ktor Version and Engine Used (client or server and name)
io.ktor:ktor-server-cio:1.3.2

Describe the bug
Request must include Host parameter(see https://tools.ietf.org/html/rfc2616#section-14.23)

To Reproduce
Steps to reproduce the behavior:
Run code:

import io.ktor.http.cio.parseRequest
import io.ktor.utils.io.ByteReadChannel
import kotlinx.coroutines.runBlocking

fun main() {
    test(
        """
        GET / HTTP/1.1
        

        """.trimIndent()
    )
}

fun test(http: String) {
    val request = runBlocking { parseRequest(ByteReadChannel(http)) }!!
    println("method=${request.method};uri={${request.uri}};headers=[${request.headers}]")
}

Expected behavior
An error expected - exception or null result.

@zuevmaxim zuevmaxim added the bug label May 14, 2020
@e5l e5l self-assigned this May 15, 2020
@oleg-larshin
Copy link

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.

@Stexxe Stexxe closed this as completed Feb 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants