Last modified: 2012-12-01 16:52:22 UTC
When logging in via the commons API https://commons.wikimedia.org/w/api.php with an IE user agent, the response says "Connection: close" even if "Connection: Keep-Alive" is set in the request. This behavior is not seen if the user-agent is set to Firefox. Steps to replicate: **IE user agent request** POST https://commons.wikimedia.org/w/api.php HTTP/1.1 Accept: */* Accept-Language: en-us Content-Type: application/x-www-form-urlencoded Accept-Encoding: gzip, deflate User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0) Host: commons.wikimedia.org Content-Length: 51 Connection: Keep-Alive Cache-Control: no-cache format=xml&action=login&lgname=user&lgpassword=pass **IE user agent response** HTTP/1.1 200 OK Server: nginx/0.7.65 Date: Thu, 15 Nov 2012 01:10:11 GMT Content-Type: text/xml; charset=utf-8 Connection: close X-Content-Type-Options: nosniff Cache-Control: private Set-Cookie: commonswiki_session=<removed>; path=/; secure; HttpOnly X-Frame-Options: SAMEORIGIN Vary: Accept-Encoding Content-Length: 173 X-Cache: MISS from cp1003.eqiad.wmnet X-Cache-Lookup: MISS from cp1003.eqiad.wmnet:3128 X-Cache: MISS from cp1011.eqiad.wmnet X-Cache-Lookup: MISS from cp1011.eqiad.wmnet:80 <?xml version="1.0"?><api><login result="NeedToken" token="<removed>" cookieprefix="commonswiki" sessionid="<removed>" /></api> -------------------------------------------------------------------- **Firefox user agent request** POST https://commons.wikimedia.org/w/api.php HTTP/1.1 Accept: */* Accept-Language: en-us Content-Type: application/x-www-form-urlencoded Accept-Encoding: gzip, deflate User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20100101 Firefox/11.0 Host: commons.wikimedia.org Content-Length: 51 Connection: Keep-Alive Cache-Control: no-cache format=xml&action=login&lgname=user&lgpassword=pass **Firefox user agent response** HTTP/1.1 200 OK Server: nginx/0.7.65 Date: Thu, 15 Nov 2012 01:14:11 GMT Content-Type: text/xml; charset=utf-8 Connection: keep-alive X-Content-Type-Options: nosniff Cache-Control: private Set-Cookie: commonswiki_session=<removed>; path=/; secure; HttpOnly X-Frame-Options: SAMEORIGIN Vary: Accept-Encoding Content-Length: 173 X-Cache: MISS from cp1003.eqiad.wmnet X-Cache-Lookup: MISS from cp1003.eqiad.wmnet:3128 X-Cache: MISS from cp1010.eqiad.wmnet X-Cache-Lookup: MISS from cp1010.eqiad.wmnet:80 <?xml version="1.0"?><api><login result="NeedToken" token="<removed>" cookieprefix="commonswiki" sessionid="<removed>" /></api> Could this be related to: http://blogs.msdn.com/b/ieinternals/archive/2011/03/26/https-and-connection-close-is-your-apache-modssl-server-configuration-set-to-slow.aspx
Why are you using an IE user agent?
Unless you're using XMLHttpRequest out of the browser, do not use a browser's user agent. See https://meta.wikimedia.org/wiki/User-Agent_policy. However, I tried manually sending the same request you list for your "IE user agent", and it gave me Connection: keep-alive.
It works...must've been some windows settings.