mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-26 02:18:04 +01:00
#4071: PageCompiler: add referrerPolicy to page directive
This commit is contained in:
@@ -273,6 +273,10 @@ header in the request.
|
||||
|
||||
Allows to specify the value of the HTTP Content-Security-Policy header.
|
||||
|
||||
!referrerPolicy
|
||||
|
||||
Allows to specify the value of the HTTP Referrer-Policy header.
|
||||
|
||||
!chunked
|
||||
|
||||
Allows you to specify whether the response is sent using chunked transfer encoding.
|
||||
|
||||
@@ -317,6 +317,7 @@ void CodeWriter::writeResponse(std::ostream& ostr)
|
||||
std::string contentType(_page.get("page.contentType", "text/html"));
|
||||
std::string contentLang(_page.get("page.contentLanguage", ""));
|
||||
std::string contentSecurityPolicy(_page.get("page.contentSecurityPolicy", ""));
|
||||
std::string referrerPolicy(_page.get("page.referrerPolicy", ""));
|
||||
std::string cacheControl(_page.get("page.cacheControl", ""));
|
||||
bool buffered(_page.getBool("page.buffered", false));
|
||||
bool chunked(_page.getBool("page.chunked", !buffered));
|
||||
@@ -339,6 +340,10 @@ void CodeWriter::writeResponse(std::ostream& ostr)
|
||||
{
|
||||
ostr << "\tresponse.set(\"Content-Security-Policy\"s, \"" << contentSecurityPolicy << "\"s);\n";
|
||||
}
|
||||
if (!referrerPolicy.empty())
|
||||
{
|
||||
ostr << "\tresponse.set(\"Referrer-Policy\"s, \"" << referrerPolicy << "\"s);\n";
|
||||
}
|
||||
if (compressed)
|
||||
{
|
||||
ostr << "\tbool _compressResponse(request.hasToken(\"Accept-Encoding\"s, \"gzip\"s));\n"
|
||||
|
||||
@@ -216,7 +216,7 @@ protected:
|
||||
helpFormatter.setHeader(
|
||||
"\n"
|
||||
"The POCO C++ Server Page Compiler.\n"
|
||||
"Copyright (c) 2008-2022 by Applied Informatics Software Engineering GmbH.\n"
|
||||
"Copyright (c) 2008-2023 by Applied Informatics Software Engineering GmbH.\n"
|
||||
"All rights reserved.\n\n"
|
||||
"This program compiles web pages containing embedded C++ code "
|
||||
"into a C++ class that can be used with the HTTP server "
|
||||
|
||||
Reference in New Issue
Block a user