From 70f829ba4ac126ade96a4438c6451e62f7c9dafd Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 28 Oct 2014 11:02:01 +0100 Subject: add some more HTTP headers --- README.md | 3 ++- cqrlogo.c | 5 ++++- lib/libcqrlogo.h | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 35f26ba..d5bd8ca 100644 --- a/README.md +++ b/README.md @@ -101,7 +101,8 @@ your custom needs. This is minimal sample source code: } /* print HTTP header */ - fputs(CQR_MIMEHEADER, stdout); + fputs(CQR_HEADER_CONTENT_TYPE, stdout); + fputc('\n', stdout); /* write PNG data to stdout */ if (fwrite(png->buffer, png->size, 1, stdout) != 1) { diff --git a/cqrlogo.c b/cqrlogo.c index 9ba947d..80b57e0 100644 --- a/cqrlogo.c +++ b/cqrlogo.c @@ -102,7 +102,10 @@ int main(int argc, char **argv) { } /* print HTTP header */ - fputs(CQR_MIMEHEADER, stdout); + fputs(CQR_HEADER_CONTENT_TYPE, stdout); + fputs(CQR_HEADER_CONTENT_DISPOSITION, stdout); + fputs(CQR_HEADER_PRAGMA, stdout); + fputc('\n', stdout); /* write PNG data to stdout */ if (fwrite(png->buffer, png->size, 1, stdout) != 1) { diff --git a/lib/libcqrlogo.h b/lib/libcqrlogo.h index 0a8429b..eb945b1 100644 --- a/lib/libcqrlogo.h +++ b/lib/libcqrlogo.h @@ -42,7 +42,9 @@ struct cqr_conf { bool overwrite; }; -#define CQR_MIMEHEADER "Content-Type: image/png\n\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" #define CQR_META_COMMENT 0x1 #define CQR_META_REFERER 0x2 -- cgit v1.2.3-70-g09d2