Skip to content

Multi-value tornado headers are fetched with get() rather than get_list() #1109

Open

Description

@sirosen

In the tornado parser, we have multidict support for headers which gets data using get(...). This combines headers, and therefore gives wrong results.
Given the setup:

>>> import tornado
>>> h = tornado.httputil.HTTPHeaders()
>>> h.add("a", "foo")
>>> h.add("a", "bar")

Compare:

>>> h.get("a")
'foo,bar'
>>> h.get_list("a")
['foo', 'bar']

We should add a regression test for this and a fix.


This was flagged in #1108, which was summarily closed as a low-quality PR in violation of our AI policy.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions