mirror of
https://github.com/pocoproject/poco.git
synced 2025-01-19 00:46:03 +01:00
fix PageCompiler cross-compile; fix Content-Security-Policy header
This commit is contained in:
parent
2f33db9053
commit
9f215be08d
@ -5,15 +5,13 @@
|
||||
#
|
||||
|
||||
include $(POCO_BASE)/build/rules/global
|
||||
include $(POCO_BASE)/PageCompiler/PageCompiler.make
|
||||
|
||||
# Cygwin Poco*.dll should be on PATH
|
||||
ifeq ($(OSNAME), CYGWIN)
|
||||
PATH :=$(LIBPATH):$(PATH)
|
||||
endif
|
||||
|
||||
# Where to find the PageCompiler executable
|
||||
PAGECOMPILER = $(POCO_BUILD)/PageCompiler/bin/$(OSNAME)/$(OSARCH)/cpspc
|
||||
|
||||
objects = HTTPTimeServerApp TimeHandler
|
||||
|
||||
target = HTTPTimeServer
|
||||
@ -29,4 +27,4 @@ endif
|
||||
# Rule for runnning PageCompiler
|
||||
src/%.cpp: src/%.cpsp
|
||||
@echo "** Compiling Page" $<
|
||||
$(SET_LD_LIBRARY_PATH) $(PAGECOMPILER) $<
|
||||
$(SET_LD_LIBRARY_PATH) $(PAGE_COMPILER) $<
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// TimeHandler.cpp
|
||||
//
|
||||
// This file has been generated from TimeHandler.cpsp on 2016-05-08 21:03:48.
|
||||
// This file has been generated from TimeHandler.cpsp on 2021-06-24 17:01:24.
|
||||
//
|
||||
|
||||
|
||||
@ -9,26 +9,22 @@
|
||||
#include "Poco/Net/HTTPServerRequest.h"
|
||||
#include "Poco/Net/HTTPServerResponse.h"
|
||||
#include "Poco/Net/HTMLForm.h"
|
||||
|
||||
|
||||
#include "Poco/DateTime.h"
|
||||
#include "Poco/DateTimeFormatter.h"
|
||||
|
||||
|
||||
using namespace std::string_literals;
|
||||
|
||||
|
||||
void TimeHandler::handleRequest(Poco::Net::HTTPServerRequest& request, Poco::Net::HTTPServerResponse& response)
|
||||
{
|
||||
response.setChunkedTransferEncoding(true);
|
||||
response.setContentType("text/html");
|
||||
response.setContentType("text/html"s);
|
||||
|
||||
Poco::Net::HTMLForm form(request, request.stream());
|
||||
std::ostream& responseStream = response.send();
|
||||
responseStream << "";
|
||||
responseStream << "\n";
|
||||
responseStream << "";
|
||||
responseStream << "\n";
|
||||
responseStream << "\n";
|
||||
responseStream << "";
|
||||
#line 6 "Z:\\git\\poco-1.7.3\\PageCompiler\\samples\\HTTPTimeServer\\src\\TimeHandler.cpsp"
|
||||
#line 6 "/Users/guenter/ws/poco-1.11/PageCompiler/samples/HTTPTimeServer/src/TimeHandler.cpsp"
|
||||
|
||||
Poco::DateTime now;
|
||||
std::string dt(Poco::DateTimeFormatter::format(now, "%W, %e %b %y %H:%M:%S %Z"));
|
||||
@ -40,10 +36,9 @@ void TimeHandler::handleRequest(Poco::Net::HTTPServerRequest& request, Poco::Net
|
||||
responseStream << "</head>\n";
|
||||
responseStream << "<body>\n";
|
||||
responseStream << "<p style=\"text-align: center; font-size: 48px;\">";
|
||||
#line 16 "Z:\\git\\poco-1.7.3\\PageCompiler\\samples\\HTTPTimeServer\\src\\TimeHandler.cpsp"
|
||||
#line 16 "/Users/guenter/ws/poco-1.11/PageCompiler/samples/HTTPTimeServer/src/TimeHandler.cpsp"
|
||||
responseStream << ( dt );
|
||||
responseStream << "</p>\n";
|
||||
responseStream << "</body>\n";
|
||||
responseStream << "</html>\n";
|
||||
responseStream << "";
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// TimeHandler.h
|
||||
//
|
||||
// This file has been generated from TimeHandler.cpsp on 2016-05-08 21:03:48.
|
||||
// This file has been generated from TimeHandler.cpsp on 2021-06-24 17:01:24.
|
||||
//
|
||||
|
||||
|
||||
|
@ -337,7 +337,7 @@ void CodeWriter::writeResponse(std::ostream& ostr)
|
||||
}
|
||||
if (!contentSecurityPolicy.empty())
|
||||
{
|
||||
ostr << "\tresponse.set(\"Content-Secure-Policy\"s, \"" << contentSecurityPolicy << "\"s);\n";
|
||||
ostr << "\tresponse.set(\"Content-Security-Policy\"s, \"" << contentSecurityPolicy << "\"s);\n";
|
||||
}
|
||||
if (compressed)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user