From ee2a118c1f7125db67018380996f90f809fbb4a2 Mon Sep 17 00:00:00 2001 From: tastytea Date: Mon, 26 Nov 2018 02:36:20 +0100 Subject: [PATCH] Added some headers. Cache-Control: max-age=86400 Connection: close Server: libravatarserv/version --- CMakeLists.txt | 2 +- src/libravatarserv.cpp | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0a08c59..20b598e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required (VERSION 3.2) project(libravatarserv - VERSION 0.2.5 + VERSION 0.3.0 LANGUAGES CXX ) diff --git a/src/libravatarserv.cpp b/src/libravatarserv.cpp index eae2aa0..5c11886 100644 --- a/src/libravatarserv.cpp +++ b/src/libravatarserv.cpp @@ -18,6 +18,7 @@ #include #include #include +#include "version.hpp" #include "libravatarserv.hpp" using std::cout; @@ -79,7 +80,10 @@ int main() image::Image answer = image::get(digest, size); if (answer.error == 0) { - cout << "Content-type: image/png\n\n"; + cout << "Content-type: image/png\n"; + cout << "Cache-Control: max-age=86400\n"; + cout << "Connection: close\n"; + cout << "Server: libravatarserv/" << global::version << endl << endl; cout.flush(); // We need to flush before we use /dev/stdout directly. // answer.image.write("test.png"); answer.image.write("/dev/stdout");