# HG changeset patch # Parent 7ae156f07a900114a97e585ad58132c007cb17c8 diff -r 7ae156f07a90 Lib/http/client.py --- a/Lib/http/client.py Sun Feb 15 00:45:57 2015 +0200 +++ b/Lib/http/client.py Sun Feb 15 04:48:24 2015 +0000 @@ -108,35 +108,8 @@ _MAXHEADERS = 100 -class HTTPMessage(email.message.Message): - # XXX The only usage of this method is in - # http.server.CGIHTTPRequestHandler. Maybe move the code there so - # that it doesn't need to be part of the public API. The API has - # never been defined so this could cause backwards compatibility - # issues. - - def getallmatchingheaders(self, name): - """Find all header lines matching a given header name. - - Look through the list of headers and find all lines matching a given - header name (and their continuation lines). A list of the lines is - returned, without interpretation. If the header does not occur, an - empty list is returned. If the header occurs multiple times, all - occurrences are returned. Case is not important in the header name. - - """ - name = name.lower() + ':' - n = len(name) - lst = [] - hit = 0 - for line in self.keys(): - if line[:n].lower() == name: - hit = 1 - elif not line[:1].isspace(): - hit = 0 - if hit: - lst.append(line) - return lst +# HTTPMessage name kept for backwards compatibility +HTTPMessage = email.message.Message def parse_headers(fp, _class=HTTPMessage): """Parses only RFC2822 headers from a file pointer.