summaryrefslogtreecommitdiff
path: root/project2/cgi/cgiResultWritable.cpp
blob: 357a57cd94178c6d4dc61da3c03a18b85c3d59ef (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, ExecContext * ec) 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, ec);
		}
};
DECLARE_TRANSFORM(WritableToCgiResult);