Commits

Erik Romijn  committed 7df29f2

update to 1.4.2; fix hsts check

  • Participants
  • Parent commits 300c59f

Comments (0)

Files changed (2)

File ponycheckup/check/checker.py

 
         check_record = Check(url=url)
 
-        check_record.hsts_header_found   = True if homepage.info().get('Strict-Transport-Security') else False
+        check_record.hsts_header_found   = self.check_supports_hsts(url)
         check_record.xframe_header_found = True if homepage.info().get('X-Frame-Options') else False
         check_record.supports_https      = self.check_supports_https(url)
 
         return True
 
 
+    def check_supports_hsts(self, url):
+        try:
+            ssltest = self.opener.open(url.replace("http", "https"), None, 7)
+        except:
+            return False
+        return ssltest.info().get('Strict-Transport-Security')
+
+
     def check_runs_debug(self, url):
         try:
             data = self.opener.open(url+"/[][][][][]-this-tries-to-trigger-404....", None, 7)

File requirements.txt

-Django==1.4
+Django==1.4.2
 django-extensions
 django-test-extensions
 werkzeug