File tree Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -772,16 +772,18 @@ void HTTPFileHandle::Initialize(optional_ptr<FileOpener> opener) {
772772 FullDownload (hfs, should_write_cache);
773773 }
774774 if (!res->headers [" Last-Modified" ].empty ()) {
775- auto result = StrpTimeFormat::Parse (" %a, %d %h %Y %T %Z" , res->headers [" Last-Modified" ]);
776- struct tm tm {};
777- tm.tm_year = result.data [0 ] - 1900 ;
778- tm.tm_mon = result.data [1 ] - 1 ;
779- tm.tm_mday = result.data [2 ];
780- tm.tm_hour = result.data [3 ];
781- tm.tm_min = result.data [4 ];
782- tm.tm_sec = result.data [5 ];
783- tm.tm_isdst = 0 ;
784- last_modified = mktime (&tm);
775+ StrpTimeFormat::ParseResult result;
776+ if (StrpTimeFormat::TryParse (" %a, %d %h %Y %T %Z" , res->headers [" Last-Modified" ], result)) {
777+ struct tm tm {};
778+ tm.tm_year = result.data [0 ] - 1900 ;
779+ tm.tm_mon = result.data [1 ] - 1 ;
780+ tm.tm_mday = result.data [2 ];
781+ tm.tm_hour = result.data [3 ];
782+ tm.tm_min = result.data [4 ];
783+ tm.tm_sec = result.data [5 ];
784+ tm.tm_isdst = 0 ;
785+ last_modified = mktime (&tm);
786+ }
785787 }
786788
787789 if (should_write_cache) {
You can’t perform that action at this time.
0 commit comments