Fix header generator
authorSteven Barth <steven@midlink.org>
Mon, 2 Mar 2009 20:18:29 +0000 (20:18 +0000)
committerSteven Barth <steven@midlink.org>
Mon, 2 Mar 2009 20:18:29 +0000 (20:18 +0000)
libs/httpclient/luasrc/httpclient.lua

index 01ef970..f3318a8 100644 (file)
@@ -164,7 +164,7 @@ function request_raw(uri, options)
        local message = {(options.method or "GET") .. " " .. path .. " " .. protocol}
        
        for k, v in pairs(headers) do
-               if type(v) == "string" then
+               if type(v) == "string" or type(v) == "number" then
                        message[#message+1] = k .. ": " .. v
                elseif type(v) == "table" then
                        for i, j in ipairs(v) do
@@ -322,4 +322,4 @@ function cookie_create(cookie)
        end
 
        return table.concat(cookiedata, "; ")
-end
\ No newline at end of file
+end