Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Expected "Hello World" response body, got "HTTP/1.1 20"

See original GitHub issue

Issue Description


I get this error when I’m asserting a response body. For some reason it asserts with a raw HTTP response:

res.format(obj) > should send text by default
Error: expected "Hello World" response body, got "HTTP/1.1 20"
    at error (
    at Test.#assertBody (
    at Test.#assertFunction (
    at Test.#assert (
    at async close (


        res.format(obj) > should send text by default

test result: FAILED. 121 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out (4184ms)


deno 1.12.0 (release, x86_64-unknown-linux-gnu) v8 typescript 4.3.2

  • SuperDeno Version: 4.4.0


import { describe, it, run } from ''
import { App, Handler, AppConstructor, Request, Response } from ''

const runServer = (h: Handler) => {
  const app = new App()


  const request = superdeno(app.attach)

  return request

it('should send text by default', async () => {
    const request = runServer((req, res) => {
      formatResponse(req, res, () => {})({
        text: (req: Request) => req.respond({ body: `Hello World` })

    await request.get('/').expect(200).expect('Hello World')

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (8 by maintainers)

github_iconTop GitHub Comments

talentlessguycommented, Jul 19, 2021

@cmorten ah my bad, the source for formatResponse is here:

it’s almost the same as in Opine’s res.format

regarding app.attach… it just immediately mounts the app handler to a server, so nothing fancy.

you can check the source here:

tomorrow I’ll try to make a reproduction with serve instead and I’ll see what’s happening

asos-craigmortencommented, Jul 21, 2021

Issue lies upstream.

Read more comments on GitHub >

github_iconTop Results From Across the Web

http2 request to a http1 fastify server hits "default handler for ...
Expected Behavior. http2 requests to an http1 server should not lead to warning log entries. it seems like maybe fastify should respond with...
Read more >
HTTP/1.1 200 OK doesn't work? - Stack Overflow
This rule about newline style and US-ASCII encoding only applies to the HTTP header, the response body are free to use other newline...
Read more >
Asserting Response - Hurl
Asserting Response. Version - Status. Expected protocol version and status code of the HTTP response. Protocol version is one of HTTP/1.0 , HTTP/1.1...
Read more >
Hello World, With Content Types - Pedestal
It's time to see how Pedestal handles content types and response bodies. We will also get our first taste of interceptors.
Read more >
HTTP/1.1: Status Code Definitions
The request has succeeded. The information returned with the response is dependent on the method used in the request, for example: GET an...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found