Always use followRedir() to determine if redirections should be followed.
Before every HEAD and GET request allowed redirection by default, without setting a limit on the number of redirections. This caused an infinite redirect loop when connecting to marketplace, in combination with the bug that we did not allow cookies.
This commit is contained in:
@@ -2137,6 +2137,12 @@ void BufferedCurlEasyRequest::setStatusAndReason(U32 status, std::string const&
|
||||
mStatus = status;
|
||||
mReason = reason;
|
||||
AICurlInterface::Stats::status_count[AICurlInterface::Stats::status2index(mStatus)]++;
|
||||
|
||||
// Sanity check. If the server replies with a redirect status then we better have that option turned on!
|
||||
if ((status >= 300 && status < 400) && mResponder && !mResponder->followRedir())
|
||||
{
|
||||
llerrs << "Received " << status << " (" << reason << ") for responder \"" << mTimeoutPolicy->name() << "\" which has no followRedir()!" << llendl;
|
||||
}
|
||||
}
|
||||
|
||||
void BufferedCurlEasyRequest::processOutput(void)
|
||||
|
||||
Reference in New Issue
Block a user