Re: JSON headers

On 11 July 2016 at 23:22, Willy Tarreau <w@1wt.eu> wrote:

> On Mon, Jul 11, 2016 at 03:47:32PM -0400, Yanick Rochon wrote:
> > On 11 July 2016 at 15:25, Willy Tarreau <w@1wt.eu> wrote:
> >
> For me it means it sent two values for the Accept header defined as a list,
> the first one being "appliation/xml...", and the second one
> "text/plain...".
> ... *snip*


> Since it seams easy to me I'm having an issue understanding the deeper
> problem and am pretty sure I missed something :-/
>

Well, first arrays are enclosed in square brackets, nor curly ones :)

Second, I am not talking about the format per se, but about possible
headers being sent as described (i.e. with duplicated keys). Of course,
JavaScript objects cannot have duplicate keys, however JSON representations
as strings are not bound to this limitation, and may very well be sent as
such. (Also, even if it is expected that every values must be an array,
JSON allows a few more possible values to be set, like strings, etc.) The
point is that, { "Accept": "...", "Accept": [ "..." ] } is a valid JSON
object, yet is (or should be) invalid as header value. What then?

Received on Tuesday, 12 July 2016 03:58:54 UTC