Skip to content

Commit

Permalink
use decoderfcdatetime
Browse files Browse the repository at this point in the history
  • Loading branch information
riderkick committed Feb 7, 2018
1 parent f53e055 commit a41b1bf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
11 changes: 4 additions & 7 deletions baseunits/httpsendthread.pas
Original file line number Diff line number Diff line change
Expand Up @@ -357,15 +357,12 @@ procedure THTTPSendThread.ParseCookiesExpires;
s := Copy(s, p, Length(s));
s := SeparateLeft(SeparateRight(s,'='),';');
s := Trim(SeparateLeft(s, 'GMT'));
c := 0.0;
try
c := UniversalTimeToLocal(ScanDateTime(HTTPCookieExpiresFormat, s, HTTPFormatSettings));
if (FCookiesExpires = 0.0) or (c < FCookiesExpires) then
FCookiesExpires := c;
except
end;
c := DecodeRfcDateTime(s);
if (FCookiesExpires = 0.0) or (c < FCookiesExpires) then
FCookiesExpires := c;
end;
end;
write
end;

function THTTPSendThread.InternalHTTPRequest(const Method, URL: String;
Expand Down
5 changes: 1 addition & 4 deletions baseunits/uBaseUnit.pas
Original file line number Diff line number Diff line change
Expand Up @@ -3472,10 +3472,7 @@ function SaveImageStreamToFile(AHTTP: THTTPSend; Path, FileName: String): String
s := Trim(AHTTP.Headers.Values['last-modified']);
lastmodified := 0;
if s <> '' then
try
lastmodified := DateTimeToFileDate(ScanDateTime(HTTPDateTimeFormatStr, s, FMDFormatSettings));
except
end;
lastmodified := DateTimeToFileDate(DecodeRfcDateTime(s));
Result := SaveImageStreamToFile(AHTTP.Document, Path, FileName, lastmodified);
end;

Expand Down

0 comments on commit a41b1bf

Please sign in to comment.