jetty / jetty/jetty.project

Jetty 12 should not use close-delimited message on HTTP/1.1 connections anymore (should be isolated to HTTP/1.0 connections only).

Open
#11,277 8 comments 0 reactions 0 assignees View on GitHub
Bug Specification
Dominant language
Java
Stars
4.1k
Forks
2k
Avg merge
3d 56m
Merged PRs (30d)
48

Description

**Jetty version(s)**
12

**Jetty Environment**
Any

**Java version/vendor** `(use: java -version)`
Any

**OS type/version**
Any

**Description**
Jetty has supported the old school HTTP idea on a response that if there is no `Content-Length` or `Transfer-Encoding` header, and there is a `Connection: close` header then the close of the connection is the indication that the body has been sent fully.

This was pointed out at stackoverflow on question https://stackoverflow.com/questions/77822470/jetty-12-spring-6-missing-content-length-in-response

However, when looking at [RFC7230 Section 3.3.3 - Message Body Length](https://datatracker.ietf.org/doc/html/rfc7230#section-3.3.3) we can see that this behavior should be isolated to HTTP/1.0 behaviors only.

> ```
> Since there is no way to distinguish a successfully completed,
> close-delimited message from a partially received message interrupted
> by network failure, a server SHOULD generate encoding or
> length-delimited messages whenever possible. The close-delimiting
> feature exists primarily for backwards compatibility with HTTP/1.0.
> ```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.