libs/lucid-http: make chunksinks cope with string-like udata
[project/luci.git] / libs / lucid-http / luasrc / lucid / http / server.lua
index 4bbec31..00c6b84 100644 (file)
@@ -288,7 +288,7 @@ local function chunksink(sock)
                if not chunk then
                        return sock:writeall("0\r\n\r\n")
                else
-                       return sock:writeall(("%X\r\n%s\r\n"):format(#chunk, chunk))
+                       return sock:writeall(("%X\r\n%s\r\n"):format(#chunk, tostring(chunk)))
                end
        end
 end