Some browsers send crippled content-type headers when it comes to XHR, catch them...
authorSteven Barth <steven@midlink.org>
Tue, 21 Oct 2008 20:25:29 +0000 (20:25 +0000)
committerSteven Barth <steven@midlink.org>
Tue, 21 Oct 2008 20:25:29 +0000 (20:25 +0000)
libs/http/luasrc/http/protocol.lua

index b9a50effe399f3e469b906066fdaf37c2f730c2b..e0c15015b28890330406210cc22d47d52a7aff80 100644 (file)
@@ -563,7 +563,7 @@ function parse_message_header( src )
                        -- Populate common environment variables
                        msg.env = {
                                CONTENT_LENGTH    = msg.headers['Content-Length'];
-                               CONTENT_TYPE      = msg.headers['Content-Type'];
+                               CONTENT_TYPE      = msg.headers['Content-Type'] or msg.headers['Content-type'];
                                REQUEST_METHOD    = msg.request_method:upper();
                                REQUEST_URI       = msg.request_uri;
                                SCRIPT_NAME       = msg.request_uri:gsub("?.+$","");