Added some headers.
Cache-Control: max-age=86400 Connection: close Server: libravatarserv/version
This commit is contained in:
parent
a2254a9ae5
commit
ee2a118c1f
@ -1,6 +1,6 @@
|
||||
cmake_minimum_required (VERSION 3.2)
|
||||
project(libravatarserv
|
||||
VERSION 0.2.5
|
||||
VERSION 0.3.0
|
||||
LANGUAGES CXX
|
||||
)
|
||||
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include <algorithm>
|
||||
#include <cstdlib>
|
||||
#include <basedir.h>
|
||||
#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");
|
||||
|
Loading…
x
Reference in New Issue
Block a user