From 8bc138f18b039060cc7e4c93f364b35a1eb5b8e3 Mon Sep 17 00:00:00 2001 From: Charles Jones Date: Tue, 30 Jul 2013 13:38:59 -0500 Subject: [PATCH 1/2] Reset to original url when falling back to GET --- linkcheck/checker/httpurl.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/linkcheck/checker/httpurl.py b/linkcheck/checker/httpurl.py index 3fcec9b1..80e6d579 100644 --- a/linkcheck/checker/httpurl.py +++ b/linkcheck/checker/httpurl.py @@ -285,6 +285,8 @@ class HttpUrl (internpaturl.InternPatternUrl, proxysupport.ProxySupport, pooledc """Set method to GET and clear aliases.""" self.method = "GET" self.aliases = [] + self.urlparts = strformat.url_unicode_split(self.url) + self.build_url_parts() def construct_auth (self): """Construct HTTP Basic authentication credentials if there From 4294633c0450e6486a6af32dd747f76e1924ead1 Mon Sep 17 00:00:00 2001 From: Charles Jones Date: Fri, 9 Aug 2013 13:08:51 -0500 Subject: [PATCH 2/2] Close connection prior to falling back to get, since we change the url back to the original at that time. --- linkcheck/checker/httpurl.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/linkcheck/checker/httpurl.py b/linkcheck/checker/httpurl.py index 80e6d579..f4c1a8b5 100644 --- a/linkcheck/checker/httpurl.py +++ b/linkcheck/checker/httpurl.py @@ -283,6 +283,8 @@ class HttpUrl (internpaturl.InternPatternUrl, proxysupport.ProxySupport, pooledc def fallback_to_get(self): """Set method to GET and clear aliases.""" + self.close_response() + self.close_connection() self.method = "GET" self.aliases = [] self.urlparts = strformat.url_unicode_split(self.url)