示例#1
0
 def __getitem__(self, key, _get_mode=False):
     # _get_mode is a no-op for this class as there is no index but
     # used because get() calls it.
     key = key.upper().replace('-', '_')
     if key in ('CONTENT_TYPE', 'CONTENT_LENGTH'):
         return unicodify_header_value(self.environ[key])
     return unicodify_header_value(self.environ['HTTP_' + key])
示例#2
0
文件: wsgi.py 项目: bwhmather/verktyg
 def __getitem__(self, key, _get_mode=False):
     # _get_mode is a no-op for this class as there is no index but
     # used because get() calls it.
     key = key.upper().replace('-', '_')
     if key in ('CONTENT_TYPE', 'CONTENT_LENGTH'):
         return unicodify_header_value(self.environ[key])
     return unicodify_header_value(self.environ['HTTP_' + key])
示例#3
0
 def __iter__(self):
     for key, value in self.environ.items():
         if (key.startswith('HTTP_') and key
                 not in ('HTTP_CONTENT_TYPE', 'HTTP_CONTENT_LENGTH')):
             yield (key[5:].replace('_', '-').title(),
                    unicodify_header_value(value))
         elif key in ('CONTENT_TYPE', 'CONTENT_LENGTH'):
             yield (key.replace('_',
                                '-').title(), unicodify_header_value(value))
示例#4
0
文件: wsgi.py 项目: bwhmather/verktyg
 def __iter__(self):
     for key, value in self.environ.items():
         if (
             key.startswith('HTTP_') and
             key not in ('HTTP_CONTENT_TYPE', 'HTTP_CONTENT_LENGTH')
         ):
             yield (
                 key[5:].replace('_', '-').title(),
                 unicodify_header_value(value),
             )
         elif key in ('CONTENT_TYPE', 'CONTENT_LENGTH'):
             yield (
                 key.replace('_', '-').title(),
                 unicodify_header_value(value),
             )