File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change 11Unreleased
22
3+ * Fix internal redirect checker (Timo Ludwig, #180)
34* Fix SSL status of unreachable domains (Timo Ludwig, #184)
45* Fix URL message for internal server errorrs (Timo Ludwig, #182)
56* Add support for Django 4.2
Original file line number Diff line number Diff line change @@ -331,9 +331,14 @@ def check_internal(self):
331331 self .message = 'Working internal link'
332332 self .status = True
333333 elif response .status_code < 400 :
334+ initial_location = response .get ('Location' )
334335 redirect_type = "permanent" if response .status_code == 301 else "temporary"
335- response = c .get (self .internal_url , follow = True )
336- self .redirect_to , _ = response .redirect_chain [- 1 ]
336+ with modify_settings (ALLOWED_HOSTS = {'append' : 'testserver' }):
337+ response = c .get (self .internal_url , follow = True )
338+ if response .redirect_chain :
339+ self .redirect_to , _ = response .redirect_chain [- 1 ]
340+ else :
341+ self .redirect_to = initial_location
337342 self .redirect_status_code = response .status_code
338343 self .status = response .status_code < 300
339344 redirect_result = "Working" if self .status else "Broken"
You can’t perform that action at this time.
0 commit comments