Skip to content

HTTP HEAD request returns response body where it should not #1447

@andrew-jones

Description

@andrew-jones

Describe the bug
Sending an http head request to ttyd returns the full response body where it should just calculate content-length and return an empty body.

To Reproduce
Steps to reproduce the behavior:

  1. Connect to ttyd with telnet - telnet localhost 7681
  2. Send HEAD /
  3. Hit Enter twice
  4. Observe the response body

Expected behavior
Expecting content-length to be set correctly and no data in the response body.

Additional context
This was discovered using a reverse proxy. Caddy (written in golang) logs an error returning a HEAD request from ttyd.

Unsolicited response received on idle HTTP channel starting with \

I use curl --head in my readiness check and the current logging is too verbose and returns the body. So I've dropped --head for now, as the network traffic is the same and I don't want the ttyd index page logged every 20 seconds.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions