Skip to content

WebDav server incorrectly outputs two Content-Length headers for HEAD requests #29

@fredsa

Description

@fredsa
$ curl 'http://meatloaf.local/' -I -H 'User-Agent: MEATLOAF/'
HTTP/1.1 200 OK
Content-Type: text/html
Content-Length: 0
Allow: COPY,DELETE,GET,HEAD,LOCK,MKCOL,MOVE,OPTIONS,PROPFIND,PROPPATCH,PUT,UNLOCK
Connection: Keep-Alive
Content-Length: 84
DAV: 1,2
ETag: 6AF3713B2281B7B44AAF87EC6A703CB965BF5E68
Keep-Alive: timeout=5, max=100
Last-Modified: Fri, 23 May 2025 04:03:41 GMT

Having both of these headers present is invalid per RFC 9110: HTTP Semantics.

Content-Length: 0
Content-Length: 84

The presence of the extra Content-Length field causes parsing exceptions in HTTP clients (example).

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