[tor-bugs] #11977 [Ooni]: Modified TrueHeaders class to order headers
Tor Bug Tracker & Wiki
blackhole at torproject.org
Thu May 15 15:40:28 UTC 2014
#11977: Modified TrueHeaders class to order headers
-------------------------+-------------------------
Reporter: cypherpunks | Owner: hellais
Type: defect | Status: new
Priority: normal | Milestone:
Component: Ooni | Version:
Keywords: | Actual Points:
Parent ID: | Points:
-------------------------+-------------------------
This issue was automatically migrated from github issue
https://github.com/TheTorProject/ooni-probe/issues/298.
Fixes [Issue 254](https://github.com/TheTorProject/ooni-probe/issues/254)
by storing TrueHeaders in an `OrderedDict`.
Removes clutter from TrueHeaders class by making `_rawHeaders` a simple
`OrderedDict` mapping from header string to list of value strings. This
conforms with its type in the superclass
(`twisted.web.http_headers.Headers`) and removes the need to override a
few methods. A new dict `_headerCases` stores the mapping from lowercase
header name to their original capitalization. This is accessed by
overriding the superclass method `Headers._canonicalNameCaps`.
Adds `test_trueheaders.test_order_preserved` to ensure `getAllRawHeaders`
returns headers in the order they were set.
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/11977>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
More information about the tor-bugs
mailing list