How does wsgi handle multiple request headers with the same name?

http, python, wsgi

Solution

Multiple cookies are combined into a single header, separated by semicolons.

Multiple headers are allowed by the HTTP spec, but only for certain kinds of headers, and it is always permissible to combine those headers into one (though using commas, not semicolons)

Problem

In WSGI headers are represented in the environ as 'HTTP_XXX' values. For example the value `Cookie:` header is stored at the `HTTP_COOKIE` key of the environ. How are multiple request headers with the same header name represented?

Original source