Ticket Hash: | e5a308564b4af73908110576efe5ef877ab5bc03 | |||
Title: | Header date format Invalid on musl libc systems | |||
Status: | Closed | Type: | Code_Defect | |
Severity: | Important | Priority: | Immediate | |
Subsystem: | Resolution: | Fixed | ||
Last Modified: | 2022-02-18 14:44:30 | |||
Version Found In: | 202108141729 | |||
User Comments: | ||||
sodface added on 2021-09-24 02:13:41:
(text/x-markdown)
Alpine Linux uses musl libc vice glibc. [This commit](http://git.musl-libc.org/cgit/musl/commit/src/time/__tz.c?id=eb7f93c4f6fd0b637a9f8d6e112131b88ad2b00f) to musl libc results in strftime %Z returning "UTC" in the althttpd.c function Rfc822Date when althttpd is running on Alpine Linux and presumably any other musl libc based distro. "UTC" in date headers instead of "GMT" causes issues with some applications such as GNU wget and Alpine's package manager (apk) which uses libfetch. In the latter case, the application fails altogether. [RFC 7231](https://datatracker.ietf.org/doc/html/rfc7231#section-7.1.1.1) specifies "GMT" not "UTC". [This page on strftime](https://pubs.opengroup.org/onlinepubs/9699919799/functions/strftime.html) says: > If a struct tm broken-down time structure is created or modified by gmtime() or gmtime_r(), it is unspecified whether the result of the %Z and %z conversion specifiers shall refer to UTC or the current local timezone, when strftime() is called with such a broken-down time structure. I'm filing this bug report here as I believe the use of the %Z specifier in this context within althttpd.c is the issue and not musl libc's decision to return UTC vice GMT. See also [this forum post.](https://sqlite.org/althttpd/forumpost/c2777e3a72516e80?t=h) stephan added on 2022-02-18 14:44:30: (text/x-markdown) Fixed in [](c9214e8e4831c4ae). |