1,593
社区成员
发帖
与我相关
我的任务
分享
if (FHTTP.FHandleRedirects) and (FHTTP.FRedirectCount < FHTTP.FRedirectMax) then
begin
Result := wnGoToURL;
Request.URL := LLocation;
// GDG 21/11/2003. If it's a 303, we should do a get this time
// RLebeau 7/15/2004 - do a GET on 302 as well, as mentioned in RFC 2616
// RLebeau 1/11/2008 - turns out both situations are WRONG! RFCs 2068 an
// 2616 specifically state that changing the method to GET in response
// to 302 and 303 is errorneous. Indy 9 did it right by reusing the
// original method and source again and only changing the URL, so lets
// revert back to that same behavior!
{
if (LResponseCode = 302) or (LResponseCode = 303) then begin
Request.Source := nil;
Request.Method := Id_HTTPMethodGet;
end else begin
Request.Method := LMethod;
end;
}
Request.Method := LMethod;
end else begin
Result := wnJustExit;
Response.Location := LLocation;
end;