A penetration tester sends a request with 'Connection: keep-alive' and the server responds with 'Connection: close'. What does this indicate?
- A.The client should immediately reopen a fresh socket, resend the same request, skipping any wait for the server's own teardown to finish
- B.The server will close the TCP connection after the response, rather than keeping it open for subsequent requests
- C.The client should mark this header a permanent ban on the hostname, then route each later request through the backup pool for the rest of the session
- D.The client should downgrade to HTTP/1.0 for the remaining session, given that the server signaled it will not maintain persistent connections
Why B is correct
The Connection header controls whether the TCP connection remains open after the request. 'keep-alive' reuses the connection for multiple requests (default in HTTP/1.1). When the server responds with 'Connection: close', it signals it will close the TCP connection after this response, forcing the client to open a new connection for the next request.
Know someone studying for Web App Fundamentals? Send them this one.