Opened 4 years ago

Closed 9 months ago

#6081 enhancement closed wontfix (wontfix)

Reject unicode in http_headers

Reported by: exarkun Owned by:
Priority: normal Milestone:
Component: web Keywords:
Cc: jknight Branch:
Author:

Description

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 4 years ago by DefaultCC Plugin

  • Cc jknight added

comment:2 Changed 9 months ago by hawkowl

  • Resolution set to wontfix
  • Status changed from new to closed

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.