Index: src/squeezeplay/share/jive/net/RequestHttp.lua =================================================================== --- src/squeezeplay/share/jive/net/RequestHttp.lua (revision 9408) +++ src/squeezeplay/share/jive/net/RequestHttp.lua (working copy) @@ -41,6 +41,8 @@ -- stuff we use local _assert, pairs, tostring, type = _assert, pairs, tostring, type +local string = require("string") + local oo = require("loop.base") local url = require("socket.url") local table = require("jive.utils.table") @@ -274,10 +276,15 @@ -- statusLine, -- ")" -- ) - + + local mappedHeaders = {} + for k, v in pairs(headers) do + mappedHeaders[string.lower(k)] = v; + end + self.t_httpResponse.statusCode = statusCode self.t_httpResponse.statusLine = statusLine - self.t_httpResponse.headers = headers + self.t_httpResponse.headers = mappedHeaders local sink = self.t_httpResponse.headersSink @@ -292,7 +299,7 @@ -- returns a response header function t_getResponseHeader(self, key) if self.t_httpResponse.headers then - return self.t_httpResponse.headers[key] + return self.t_httpResponse.headers[string.lower(key)] else return nil end @@ -356,7 +363,7 @@ elseif (code == 301 or code == 302 or code == 307) and self.t_httpRequest.method == 'GET' and (not self.redirect or self.redirect < 5) then - local redirectUrl = self.t_httpResponse.headers["Location"] + local redirectUrl = self:t_getResponseHeader("Location") log:info(code, " redirect: ", redirectUrl) -- recreate headers and parsed uri