diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2022-01-13 16:37:01 +0100 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2022-01-17 22:29:30 +0100 |
commit | aa8fd6bc39f929a2bfad6bba4bf26e69624cd88a (patch) | |
tree | 43b2c216b55faf73a1b9198cc58586b063cb4781 /tests/auto/corelib/io/qsettings | |
parent | 21735f24cf05cac5ef6f94c1fe2058b6e06ae67e (diff) |
Convert date-time to UTC before claiming it's in GMT
QNetworkHeadersPrivate::toHttpDate() used a custom format to output a
date-time; the format supplied GMT as suffix, but neglected to convert
the date-time to UTC, so local-time was formatted as if it were UTC,
regardless of its actual offset from it. Fixing this (by the obvious
toUTC() call) broke formatting when the supplied header value was a
QDate, since it's packaged as a QVariant and QVariant's conversion of
QDate to QDateTime uses local time's (not UTC's) start of day. So fix
headerValue() to separate QDate and QDateTime cases and use
startOfDay(Qt::UTC) to get the right start of the day. Added tests for
non-UTC date-times appearing correctly in HTTP headers.
Fixes: QTBUG-80666
Pick-to: 6.3 6.2 6.2.3 5.15
Change-Id: I2792bce14a07be025cf551b0594630260c112269
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'tests/auto/corelib/io/qsettings')
0 files changed, 0 insertions, 0 deletions