Skip to content

Unhandled scope of http exceptions #1441

@XriXis

Description

@XriXis

On a control char in the request, instead of response with 400 code thread with server just lies down, because HttpException thrown at BkBasic#accept, while initializing arguments for the BkBasic#print, where HttpException s are actually handled

Error with 400 response code occurs on RqLive construction. While general handling of http errors, and creation of corresponding response occurs in the method, that called after (and require) RqLive initialisation

Problematic lines are marked by red background:

Image

Stack trace on receiving "GET /\n":
Exception in thread "Thread-0" java.lang.IllegalStateException: org.takes.HttpException: [400] illegal character 0x0A in HTTP header line #1: "GET /"
at org.takes.http.BkBasicTest.lambda$returnsABadRequestToAnInvalidRequestUri$6(BkBasicTest.java:358)
at java.base/java.lang.Thread.run(Thread.java:1570)
Caused by: org.takes.HttpException: [400] illegal character 0x0A in HTTP header line #1: "GET /"
at org.takes.rq.RqLive.legalCharacter(RqLive.java:137)
at org.takes.rq.RqLive.parse(RqLive.java:69)
at org.takes.rq.RqLive.(RqLive.java:37)
at org.takes.http.BkBasic.accept(BkBasic.java:80)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions