25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

16 lines
306 B

  1. """
  2. Compatibility Support for Python 2.7 and earlier
  3. """
  4. import sys
  5. def get_all_headers(message, key):
  6. """
  7. Given an HTTPMessage, return all headers matching a given key.
  8. """
  9. return message.get_all(key)
  10. if sys.version_info < (3,):
  11. def get_all_headers(message, key):
  12. return message.getheaders(key)