Opened 9 years ago

Closed 6 years ago

#6081 enhancement closed wontfix (wontfix)

Reject unicode in http_headers

Reported by: Jean-Paul Calderone Owned by:
Priority: normal Milestone:
Component: web Keywords:
Cc: jknight Branch:


http_headers is mostly just an abstraction over a dictionary. However, its use in twisted.web means that keys nor values should ever be unicode. All strings should be byte strings. There's no checking for this in the code now, but to help out users there probably ought to be.

Change History (2)

comment:1 Changed 9 years ago by DefaultCC Plugin

Cc: jknight added

comment:2 Changed 6 years ago by hawkowl

Resolution: wontfix
Status: newclosed

With discussions from lukasa and others, it appears as it is reasonable to expect Unicode to work, and any WSGI layers will rely on giving us Unicode anyway. The headers and values are relatively unabiguously encodable/decodable, so it will work in 99.9% of cases -- and the approach in #8129 means that if random binary junk needs to be sent in headers, being bytes-clean will ensure that nothing is ever encoded or decoded.

Closing this as wontfix.

Note: See TracTickets for help on using tickets.