Changeset 1015
- Timestamp:
- 03/25/06 14:05:01
- Files:
-
- trunk/cherrypy/lib/httptools.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/lib/httptools.py
r972 r1015 370 370 371 371 372 class HeaderMap(dict): 373 """A dict subclass for HTTP request and response headers. 374 375 Each key is changed on entry to str(key).title(). This allows headers 376 to be case-insensitive and avoid duplicates. 372 class CaseInsensitiveDict(dict): 373 """A case-insensitive dict subclass. 374 375 Each key is changed on entry to str(key).title(). 377 376 """ 378 377 … … 386 385 dict.__delitem__(self, str(key).title()) 387 386 388 def __contains__(self, item):389 return dict.__contains__(self, str( item).title())387 def __contains__(self, key): 388 return dict.__contains__(self, str(key).title()) 390 389 391 390 def get(self, key, default=None): … … 416 415 def pop(self, key, default): 417 416 return dict.pop(self, str(key).title(), default) 417 418 419 class HeaderMap(CaseInsensitiveDict): 420 """A dict subclass for HTTP request and response headers. 421 422 Each key is changed on entry to str(key).title(). This allows headers 423 to be case-insensitive and avoid duplicates. 424 """ 418 425 419 426 def elements(self, key): 420 427 """Return a list of HeaderElements for the given header (or None).""" 428 key = str(key).title() 421 429 h = self.get(key) 422 430 if h is None:

