Closed mbi closed 1 year ago
Hi! Thanks for this new PR!
We had an optional setting for this before switching to the new TestClient, so we have 3 choices here: 1) enable the auto-follow-redirects after adding a setting 2) just add the auto-follow-redirects feature and activate it without any setting 3) add & activate the auto-follow-redirects feature, but add an optional setting to disable it
Since we're not using requests anymore, this feature should not bring any risks (for example this cve), so we may just allow the redirects every time, but I will re-check that there's no other problem we're missing here.
Hi! Thank you for your patience, I searched for more information on following redirects in django test client and found nothing.
Version 0.6.1 is out and includes these changes!
Awesome, thank you! I'll update my projects to use this version instead of our fork ^^
On the production machine, we have
SECURE_SSL_REDIRECT = True
, and as a result, the test client redirects by default:As a result,
response.content
is empty and BeautifulSoup chokes, resulting in a error 500 down the line.With this patch, the test client follows redirects and as a result, we get html to feed to BeautifulSoup.