Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error handling on ee9 / ee8 with HTTP/1.0 can result in an empty Connection: response header. #12104

Closed
joakime opened this issue Jul 29, 2024 · 0 comments · Fixed by #12127
Closed
Assignees
Labels
Bug For general bugs on Jetty side

Comments

@joakime
Copy link
Contributor

joakime commented Jul 29, 2024

Jetty version(s)
12.0.11 (possibly older)

Jetty Environment
ee9 / ee8

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

OS type/version
Any

Description
If an error response is produced in ee9 / ee8 from an HTTP/1.0 request then the resulting Connection: header can be empty/blank.

Example request: This is a POST request to an endpoint that doesn't exist (expected to return 404), and it doesn't send all of the request content.

POST / HTTP/1.0
Host: Localhost
Accept: text/html
Content-Length: 100
Connection: keep-alive

0123456789

The response seen:

HTTP/1.1 404 Not Found
Server: Jetty(12.0.12-SNAPSHOT)
Date: Mon, 29 Jul 2024 21:13:39 GMT
Cache-Control: must-revalidate,no-cache,no-store
Content-Type: text/html;charset=ISO-8859-1
Connection: 
Content-Length: 437

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
<title>Error 404 Not Found</title>
</head>
<body><h2>HTTP ERROR 404 Not Found</h2>
<table>
<tr><th>URI:</th><td>/</td></tr>
<tr><th>STATUS:</th><td>404</td></tr>
<tr><th>MESSAGE:</th><td>Not Found</td></tr>
<tr><th>SERVLET:</th><td>-</td></tr>
</table>
<hr/><a href="https://jetty.org/">Powered by Jetty:// 12.0.12-SNAPSHOT</a><hr/>

</body>

Notice the missing Connection response header value.

@joakime joakime added the Bug For general bugs on Jetty side label Jul 29, 2024
@joakime joakime self-assigned this Jul 29, 2024
joakime added a commit that referenced this issue Jul 29, 2024
+ Fix empty `Connection:` response
  header issue seen on HTTP/1.0
@joakime joakime moved this to 🏗 In progress in Jetty 12.0.13 - FROZEN Jul 29, 2024
gregw added a commit that referenced this issue Aug 2, 2024
Fix #12104 by better handling of `close` and `keep-alive` values in the HttpGenerator, so that we never add an empty field.
gregw added a commit that referenced this issue Aug 2, 2024
Fix #12104 by returning a CombinedResource for a ClassLoader resource that has multiple directory matches.
@gregw gregw assigned gregw and unassigned gregw Aug 2, 2024
joakime added a commit that referenced this issue Aug 2, 2024
@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in Jetty 12.0.13 - FROZEN Aug 2, 2024
gregw added a commit that referenced this issue Aug 5, 2024
Fix #12104 by returning a CombinedResource for a ClassLoader resource that has multiple directory matches.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For general bugs on Jetty side
Projects
No open projects
Status: ✅ Done
2 participants