diff --git a/PageCompiler/doc/PageCompilerUserGuide.page b/PageCompiler/doc/PageCompilerUserGuide.page index bd802e06d..d7b8a0db2 100644 --- a/PageCompiler/doc/PageCompilerUserGuide.page +++ b/PageCompiler/doc/PageCompilerUserGuide.page @@ -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. diff --git a/PageCompiler/src/CodeWriter.cpp b/PageCompiler/src/CodeWriter.cpp index 94c416fdf..330ca1d4d 100644 --- a/PageCompiler/src/CodeWriter.cpp +++ b/PageCompiler/src/CodeWriter.cpp @@ -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" diff --git a/PageCompiler/src/PageCompiler.cpp b/PageCompiler/src/PageCompiler.cpp index ccb35283b..67d7b57ff 100644 --- a/PageCompiler/src/PageCompiler.cpp +++ b/PageCompiler/src/PageCompiler.cpp @@ -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 "