title: Should a server adhere to the HTTP Connection: close header sent from a client?
body: <p>I have a HTTP client that sets the Connection header to the following value when I make a request:</p>
  
  <pre><code>   Connection: close
  </code></pre>
  
  <p>However when the server sends a response, it is setting the header to Keep-Alive:</p>
  
  <pre><code>   Connection: Keep-Alive
  </code></pre>
  
  <p>This seems intuitively wrong to me, and I am wondering how the client should handle such a response from the server?  Also why would a server respond with Keep-Alive, when the client has asked for the connection to be closed, is this valid?</p>
  
  <p>According to the HTTP RFC:</p>
  
  <p>"HTTP/1.1 defines the "close" connection option for the sender to signal that the connection will be closed after completion of the response. For example,</p>
  
  <pre><code>   Connection: close
  </code></pre>
  
  <p>in either the request or the response header fields indicates that the connection SHOULD NOT be considered `persistent' (section 8.1) after the current request/response is complete."</p>