Uploaded image for project: 'Undertow'
  1. Undertow
  2. UNDERTOW-2116

ServletOutputStreamImpl incorrectly sets Content-Length to 0

XMLWordPrintable

      When using an asynchronous WriteListener, the ServletOutputStreamImpl assumes that if not content has been written, the Content-Length header should be set to 0. See https://github.com/undertow-io/undertow/blob/20d777c181264f749a39fca7003dc9441687faa9/servlet/src/main/java/io/undertow/servlet/spec/ServletOutputStreamImpl.java#L680

      Unfortunately, this has the side effect that HEAD requests, for which no response body should be written, always end up with Content-Length 0. Even when the servlet sets the Content-Length header correctly, to whatever value you would have for a GET request.

            rhn-support-rmartinc Ricardo Martin Camarero
            apoutsma Arjen Poutsma (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: