From bd1e4507ee21d676307b5aef91611a40ccab6a1c Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Sun, 23 Jul 2017 15:48:14 -0500 Subject: [PATCH] remove unused HTTPClientHEADFactory --- src/allmydata/test/common_web.py | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/allmydata/test/common_web.py b/src/allmydata/test/common_web.py index 162b1bba8..33bcd19fb 100644 --- a/src/allmydata/test/common_web.py +++ b/src/allmydata/test/common_web.py @@ -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