Under HTTP 1.0, there is no official specification for how keepalive operates. It was, in essence, added to an existing protocol. If the browser supports keep-alive, it adds an additional header to the request:
Connection: Keep-Alive
Then, when the server receives this request and generates a response, it also adds a header to the response:
Connection: Keep-Alive
Following this, the connection is not dropped, but is instead kept open. When the client sends another request, it uses the same connection. This will continue until either the client or the server decides that the conversation is over, and one of them drops the connection.
In HTTP 1.1, all connections are considered persistent unless declared otherwise.[1]
I suspect the reason for Jetty behaving in this way is because it is not correct to set this header in HTTP 1.1 - Connection: keep-alive was something in HTTP 1.0 which is deprecated in HTTP 1.1 (I believe). What are you trying to achieve (I say this only to be able to help you further, not to question your motives :)
~ ⮀ curl -v http://localhost:3000/* About to connect() to localhost port 3000 (#0)* Trying ::1...* connected* Connected to localhost (::1) port 3000 (#0)> GET / HTTP/1.1> User-Agent: curl/7.24.0 (x86_64-apple-darwin12.0) libcurl/7.24.0 OpenSSL/0.9.8r zlib/1.2.5> Host: localhost:3000> Accept: */*>< HTTP/1.1 200 OK< Date: Mon, 14 Jan 2013 21:35:44 GMT< Content-Type: text/html;charset=UTF-8< Content-Length: 2< Server: Jetty(7.6.1.v20120215)<* Connection #0 to host localhost left intactOK* Closing connection #0
~ ⮀ curl -0v -H 'Connection: keep-alive' http://localhost:3000/* About to connect() to localhost port 3000 (#0)* Trying ::1...* connected* Connected to localhost (::1) port 3000 (#0)> GET / HTTP/1.0> User-Agent: curl/7.24.0 (x86_64-apple-darwin12.0) libcurl/7.24.0 OpenSSL/0.9.8r zlib/1.2.5> Host: localhost:3000> Accept: */*> Connection: keep-alive>< HTTP/1.1 200 OK< Date: Mon, 14 Jan 2013 21:36:50 GMT< Content-Type: text/html;charset=UTF-8< Content-Length: 2< Connection: keep-alive< Server: Jetty(7.6.1.v20120215)<* Connection #0 to host localhost left intactOK* Closing connection #0