remove unused HTTPClientHEADFactory

This commit is contained in:
Brian Warner 2017-07-23 15:48:14 -05:00
parent d018a07bf0
commit bd1e4507ee

View File

@ -66,21 +66,6 @@ class MyGetter(client.HTTPPageGetter):
handleStatus_206 = lambda self: self.handleStatus_200() # PARTIAL_CONTENT
handleStatus_304 = lambda self: self.handleStatus_200() # NOT_MODIFIED
class HTTPClientHEADFactory(client.HTTPClientFactory):
protocol = MyGetter
def noPage(self, reason):
# Twisted-2.5.0 and earlier had a bug, in which they would raise an
# exception when the response to a HEAD request had no body (when in
# fact they are defined to never have a body). This was fixed in
# Twisted-8.0 . To work around this, we catch the
# PartialDownloadError and make it disappear.
if (reason.check(client.PartialDownloadError)
and self.method.upper() == "HEAD"):
self.page("")
return
return client.HTTPClientFactory.noPage(self, reason)
class HTTPClientGETFactory(client.HTTPClientFactory):
protocol = MyGetter