Skip to content

Valid HTTP/1.1 request causes 503 Backend fetch failed #4314

@DemiMarie

Description

@DemiMarie

Expected Behavior

Varnish should either ignore or process HTTP/1.1 and HTTP/2.0 trailers, as allowed by the standards.

Current Behavior

If a request with trailers arrives over HTTP/1.1, Varnish returns a 503 Backend fetch failed to the client. If the request with trailers instead arrives over HTTP/2, Varnish does something that causes HAProxy to return a 502 Bad Gateway error.

Possible Solution

Varnish should read and discard any trailers it finds.

Steps to Reproduce (for bugs)

  1. Send a request with HTTP/1.1 or HTTP/2.0 trailers.
  2. Observe that Varnish doesn’t handle them properly, and furthermore returns a wrong error message.

Context

I found this bug by looking at other PRs and confirmed it with my own testing. I’ve been testing various HTTP implementations and found that most of them have some sort of protocol non-conformance. Notably, Varnish does strictly validate field names (which NGINX does not) and values (which neither HAProxy nor NGINX do), and that’s a good thing.

Varnish Cache version

varnishd (varnish-7.7.0 revision bb7a918) Copyright (c) 2006 Verdens Gang AS Copyright (c) 2006-2025 Varnish Software Copyright 2010-2025 UPLEX - Nils Goroll Systemoptimierung

Operating system

Arch

Source of binary packages used (if any)

Arch extra repository

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions