#2970: [patch] HttpResponse should treat headers case-insensitively
----------------------+-----------------------------------------------------
Reporter: adrian | Owner: mtredinnick
Status: new | Component: Core framework
Version: | Resolution:
Keywords: | Stage: Design decision needed
Has_patch: 1 | Needs_docs: 0
Needs_tests: 0 | Needs_better_patch: 0
----------------------+-----------------------------------------------------
Changes (by mtredinnick):
* owner: adrian => mtredinnick
* stage: Ready for checkin => Design decision needed
Comment:
There's a lot of processing overhead going on in the !CaseInsensitiveDict
class just to preserve the case of the original key. I can't think of a
reason when this is really needed (we will document that the headers are
case-insensitive so that people won't be surprised when
{{{headers.keys()}}} returns all lower-case). Am I missing some obvious
use-case beyond "it might be nice"?
If there isn't a strong reason for keeping the original key case, I'd like
to replace !CaseInsensitiveDict with something like
[http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/66315 this Python
cookbook recipe] (I'll use one of the versions from later in the comments,
since they fix problems with the earlier version). That code just looks a
bit easier to read.
I'll move this to "design decision needed" for the time being. Chris, if
I'm missing a good reason why you have that functionality, feel free to
point it out. I'm willing to admit to being dense sometimes. No need to go
to all the trouble of updating the patch if we can just make the switch:
I'll just drop in the replacement and some tests when I do the commit.
--
Ticket URL: <http://code.djangoproject.com/ticket/2970#comment:8>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---