From 11cda9a91d0e2d09f5500e654fd6daf14f2bf8dc Mon Sep 17 00:00:00 2001 From: matthias Date: Fri, 17 Jan 2025 13:45:11 +0100 Subject: [PATCH] WT-13187: Ensure that initial scripts are properly closed When serving the main page, either set up through the hybrid or conventional boot, the script will run, ensuring a response it sent to the server. This will contain all correct initial start-up information, and the way the follow-up requests ought to be handled. In this logic, we also append all initially defined resources for the application, like stylesheets or JavaScript. The latter is loaded via WApplication::require. Any script added here was not properly closed. While the script was still properly loaded, the actual bootstrapping mechanism that was below it would be commented out, and not be interpreted by the browser. This results in every new request coming in to actually be considered a NEW request, and not part of the same application. --- src/web/WebRenderer.C | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/web/WebRenderer.C b/src/web/WebRenderer.C index f0c570cb8..0d6b4df2a 100644 --- a/src/web/WebRenderer.C +++ b/src/web/WebRenderer.C @@ -1488,9 +1488,9 @@ void WebRenderer::serveMainpage(WebResponse& response) DomElement::htmlAttributeValue(styleSheets, session_.fixRelativeUrl(url)); if (conf.useScriptNonce()) { - styleSheets << " nonce=\"" << response.nonce() << "\"" - << ">\n"; + styleSheets << " nonce=\"" << response.nonce() << "\""; } + styleSheets << ">\n"; beforeLoadJS_ << app->scriptLibraries_[i].beforeLoadJS; }