summaryrefslogtreecommitdiff
path: root/project2/cgi/cgiResultWritable.cpp
blob: ea17d3b9e66b1be0cf07c852a1e00d9f456a5f75 (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);