Ok, I found the root cause.  If you used res:writeHead(code, headers), it
was impossible for luvit to know if your response had a body before
flushing the headers and so it assumed no body.  This meant no
"Transfer-Encoding: Chunked" header.

But if you used the res:setHeader(name, value) API, then the headers
weren't flushed till the first time res:write(value) or res:finish() was
called.

I've changed it to always defer writing the head on the wire till the first
write or flush.

Also I've pulled in the fancy metatable for headers from weblit that makes
working with headers much easier in lua.

See https://github.com/luvit/luvit/pull/776 for details.

On Thu, Jul 16, 2015 at 10:18 PM, Tim Caswell <[email protected]> wrote:

> I was looking for this thread the other day.  I've filed an issue to fix
> the problem luvit side. (https://github.com/luvit/luvit/issues/773) I'll
> accept the PR against luvit.io for now so people don't get stuck.
>
> On Thu, Jul 16, 2015 at 2:29 PM, Lionel Duboeuf <[email protected]>
> wrote:
>
>>
>> see PR: https://github.com/luvit/luvit.io/pull/9
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "luvit" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"luvit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to