Skip to content

error pages look weird #23

@YtvwlD

Description

@YtvwlD

We're starting the response too early, so when we transmit an error page, it won't be rendered correctly.

As an example, the timeout error looks like this:

POST OK.
start printing: foo
HTTP/1.0 500 ERROR: timed out
Server: BaseHTTP/0.6 Python/3.8.10
Date: Tue, 24 Aug 2021 16:18:10 GMT
Connection: close
Content-Type: text/html;charset=utf-8
Content-Length: 453

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
        "http://www.w3.org/TR/html4/strict.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
        <title>Error response</title>
    </head>
    <body>
        <h1>Error response</h1>
        <p>Error code: 500</p>
        <p>Message: ERROR: timed out.</p>
        <p>Error code explanation: 500 - Server got itself in trouble.</p>
    </body>
</html>

If we don't send the first two lines, we'll get the HTML rendered.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions