diff options
author | Christian Hesse <mail@eworm.de> | 2014-10-29 13:34:19 +0100 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2014-10-29 13:34:19 +0100 |
commit | dd0d07ebf2b960f87bc4775aa61d051682fa6f94 (patch) | |
tree | 9c958d69c62f988187cc1c127758b4b3ce2b6897 | |
parent | 868248b043aa569e7e429a7831e3f5d6a4935e7a (diff) | |
download | cqrlogo-dd0d07ebf2b960f87bc4775aa61d051682fa6f94.tar.gz cqrlogo-dd0d07ebf2b960f87bc4775aa61d051682fa6f94.tar.zst |
add some more HTTP headers
-rw-r--r-- | cqrlogo.c | 4 | ||||
-rw-r--r-- | cqrlogo.h | 1 | ||||
-rw-r--r-- | lib/libcqrlogo.h | 1 |
3 files changed, 6 insertions, 0 deletions
@@ -17,6 +17,7 @@ int main(int argc, char **argv) { regex_t preg; regmatch_t pmatch[1]; uint8_t https; + struct timeval tv; struct cqr_png * png; struct cqr_bitmap * bitmap; @@ -104,7 +105,10 @@ int main(int argc, char **argv) { /* print HTTP header */ fputs(CQR_HEADER_CONTENT_TYPE, stdout); fputs(CQR_HEADER_CONTENT_DISPOSITION, stdout); + fputs(CQR_HEADER_CACHE_CONTROL, stdout); fputs(CQR_HEADER_PRAGMA, stdout); + gettimeofday(&tv, NULL); + fprintf(stdout, "ETag: %lu%lu\n", tv.tv_sec, tv.tv_usec); fputc('\n', stdout); /* write PNG data to stdout */ @@ -16,6 +16,7 @@ #include <inttypes.h> #include <regex.h> #include <stdbool.h> +#include <sys/time.h> #if HAVE_FCGI #include <fcgi_stdio.h> diff --git a/lib/libcqrlogo.h b/lib/libcqrlogo.h index eb945b1..73ce149 100644 --- a/lib/libcqrlogo.h +++ b/lib/libcqrlogo.h @@ -42,6 +42,7 @@ struct cqr_conf { bool overwrite; }; +#define CQR_HEADER_CACHE_CONTROL "Cache-Control: no-cache\nCache-Control: max-age=0\n" #define CQR_HEADER_CONTENT_TYPE "Content-Type: image/png\n" #define CQR_HEADER_CONTENT_DISPOSITION "Content-Disposition: inline; filename=\"cqrlogo.png\"\n" #define CQR_HEADER_PRAGMA "Pragma: no-cache\n" |