From dd0d07ebf2b960f87bc4775aa61d051682fa6f94 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 29 Oct 2014 13:34:19 +0100 Subject: add some more HTTP headers --- cqrlogo.c | 4 ++++ cqrlogo.h | 1 + lib/libcqrlogo.h | 1 + 3 files changed, 6 insertions(+) diff --git a/cqrlogo.c b/cqrlogo.c index 80b57e0..ba4481e 100644 --- a/cqrlogo.c +++ b/cqrlogo.c @@ -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 */ diff --git a/cqrlogo.h b/cqrlogo.h index 430df26..cf5db51 100644 --- a/cqrlogo.h +++ b/cqrlogo.h @@ -16,6 +16,7 @@ #include #include #include +#include #if HAVE_FCGI #include 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" -- cgit v1.2.3-70-g09d2