[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: luasocket: HTTP and multiple headers
- From: Vladimir Dronnikov <dronnikov@...>
- Date: Mon, 13 Feb 2012 11:48:55 +0000
Hi!
LuaSocket HTTP responses concatenate same-named headers using commas.
This makes it practically impossible to reliably split them later in
application logic. Consider vanilla use case: server sets multiple
Set-Cookie:
```
Set-Cookie: foo=foo;Expires=Jan 1, 2012
Set-Cookie: bar=bar;Expires=Jan 2, 2012
```
The corresponding response headers table contains:
```
['set-cookie'] = "foo=foo;Expires=Jan 1, 2012, bar=bar;Expires=Jan 2, 2012"
```
and splitting with ',' gives false positives.
I see two straight ways to fix that: either to report array-like
tables for same-named headers, or concat using a nonce, which itself
is reported as a key to returned response table.
Or, how else this problem is solved?
TIA,
--Vladimir Dronnikov, dvv at github.com