On Wed Mar 12 10:25:16 2025 +0000, Yongjie Yao wrote:
I add 5 tests to test_http_connection(). The first test sends "Expires: 0", the second test sends "Expires: -1", the third test sends "Expires: 100", the fourth test sends "Expires: invalid date", the fifth test sends "Expires: Thu, 06 Mar 2025 06:08:11 GMT". The tests on actual windows 10 has output informations, such as:
http.c:6837: expires: 2025-03-06 06:14:13, current time: 2025-03-06 06:14:13, server response expires: 0 http.c:6837: expires: 2025-03-06 06:14:14, current time: 2025-03-06 06:14:14, server response expires: -1 http.c:6837: expires: 2025-03-06 06:14:14, current time: 2025-03-06 06:14:14, server response expires: 100 http.c:6837: expires: 2025-03-06 05:14:15, current time: 2025-03-06 06:14:15, server response expires: invalid date http.c:6837: expires: 2025-03-06 06:08:11, current time: 2025-03-06 06:14:15, server response expires: Thu, 06 Mar 2025 06:08:11 GMT
I think Windows treats all numbers as invalid values and sets the expiration time to the current system time, while other invalid values set the expiration time to one hour before the current system time, and valid expiration times use the set expiration time. In Wine, handling inconsistencies with Windows 10, We treat "0" as "1601-01-01 00:00:00", and all other invalid values as 10 minutes after the current system time. such as
http.c:6837: expires: 1601-01-01 00:00:00, current time: 2025-03-06 06:10:56, server response expires: 0 0118:err:wininet:HTTP_ParseDateAsAsctime unexpected weekday L"-1" 0118:err:wininet:HTTP_ParseDate unexpected date format L"-1" http.c:6837: expires: 2025-03-06 06:20:56, current time: 2025-03-06 06:10:57, server response expires: -1 0110:err:wininet:HTTP_ParseDateAsAsctime unexpected weekday L"100" 0110:err:wininet:HTTP_ParseDate unexpected date format L"100" http.c:6837: expires: 2025-03-06 06:20:56, current time: 2025-03-06 06:10:57, server response expires: 100 0118:err:wininet:HTTP_ParseDateAsAsctime unexpected weekday L"inv" 0118:err:wininet:HTTP_ParseDate unexpected date format L"invalid date" http.c:6837: expires: 2025-03-06 06:20:56, current time: 2025-03-06 06:10:58, server response expires: invalid date http.c:6837: expires: 2025-03-06 06:08:10, current time: 2025-03-06 06:10:58, server response expires: Thu, 06 Mar 2025 06:08:11 GMT
Those are interesting findings, thanks. Could you please also check what's the behavior for missing "Expires" header? It sounds like we should change error handling in `HTTP_ProcessExpires`, I wonder if `!expirationFound` branch there is right...