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
- B.The server only allows one request per IP address
- C.The client's keep-alive request was denied because it is malicious
- D.The server will close the TCP connection after the response, rather than keeping it open for subsequent requests
Why D 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.