An app that will analyze and report on links in any model that you register with it. Links can be bare (urls or image and file fields) or embedded in HTML (linkcheck handles the parsing). It's fairly easy to override methods of the Linkcheck object should you need to do anything more complicated (like generate URLs from slug fields etc).
This PR removes the 'verify': False, option for the checking requests, which should make sure that links with incorrect certificates are marked as invalid.
I don't see a reason why anyone would not want this and would prefer to enforce this, but if you think legacy apps might need the option to turn this off, I could also add a config value for this.
The hard part was to get at least some half-decent readable output from the requests library, unfortunately they seem to just stack their own exceptions on top of all urllib's exceptions in string representation, so I didn't find a way to extract the original exception text from the final exception without ugly regex parsing...
I tested this with a few URLs from https://badssl.com/, and the results seem to look promising:
(I didn't know how to test more options with Django's test server other than simply a missing certificate)
This PR removes the
'verify': False,
option for the checking requests, which should make sure that links with incorrect certificates are marked as invalid.I don't see a reason why anyone would not want this and would prefer to enforce this, but if you think legacy apps might need the option to turn this off, I could also add a config value for this.
The hard part was to get at least some half-decent readable output from the requests library, unfortunately they seem to just stack their own exceptions on top of all urllib's exceptions in string representation, so I didn't find a way to extract the original exception text from the final exception without ugly regex parsing...
I tested this with a few URLs from https://badssl.com/, and the results seem to look promising:
(I didn't know how to test more options with Django's test server other than simply a missing certificate)
Fixes #118