pistacheio / pistache

A high-performance REST toolkit written in C++
https://pistacheio.github.io/pistache/
Apache License 2.0
3.12k stars 685 forks source link

Support for the Last-Modified header. #1216

Closed yvesdm3000 closed 3 weeks ago

yvesdm3000 commented 4 weeks ago

Support for the "Last-Modified" header.

To note is that this header is required to be in GMT timezone. The "date" library used by Pistache doesn't support timezones so the stdlib version of gmtime() on a time_t is used to convert the time to GMT. Without this conversion it is difficult to have this value in the older GMT since most users work with the identical UTC tz but that would result in an incorrect header string ("UTC" instead of "GMT".

Complete with a unit test.

codecov[bot] commented 3 weeks ago

Codecov Report

Attention: Patch coverage is 94.11765% with 1 line in your changes missing coverage. Please review.

Project coverage is 78.49%. Comparing base (7cc8732) to head (3e580e4). Report is 26 commits behind head on master.

Files Patch % Lines
include/pistache/http_header.h 85.71% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1216 +/- ## ========================================== + Coverage 78.09% 78.49% +0.39% ========================================== Files 53 52 -1 Lines 7082 6282 -800 ========================================== - Hits 5531 4931 -600 + Misses 1551 1351 -200 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

kiplingw commented 3 weeks ago

Looks fine to me. Thanks @yvesdm3000. @Tachi107?

Tachi107 commented 3 weeks ago

Thanks for the patch :D