summaryrefslogtreecommitdiff
path: root/project2/cgi/cgiResultWritable.cpp
blob: 981f70c9055429642867cc82758b5f1fa90682a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include "pch.hpp"
#include "cgiResult.h"

class WritableToCgiResult : public TransformImpl<WritableContent, CgiResult> {
	public:
		void transform(const WritableContent * wc, CgiResult * cr) const {
			cr->header->addHeader("Content-Type", Glib::ustring::compose("%1; charset=%2", wc->getContentType(), cr->encoding));
			cr->header->addHeader("Cache-control", "no-cache");
			cr->header->render(cr->stream);
			wc->writeTo(cr->stream, cr->encoding);
		}
};
DECLARE_TRANSFORM(WritableToCgiResult);