A penetration tester sends a request with 'Connection: keep-alive' and the server responds with 'Connection: close'. What does this indicate?
- A.The server is using HTTP/2 which always closes connections; persistent connections require an explicit Connection: keep-alive header in HTTP/1.1, which otherwise closes after each exchange
- B.The server will close the TCP connection after the response, rather than keeping it open for subsequent requests
- C.The server only allows one request per IP address
- D.The client's keep-alive request was denied because it is malicious
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.