Skip to content

Commit

Permalink
WT-13187: Ensure that initial scripts are properly closed
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
matthias committed Jan 17, 2025
1 parent 024123b commit 11cda9a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/web/WebRenderer.C
Original file line number Diff line number Diff line change
Expand Up @@ -1488,9 +1488,9 @@ void WebRenderer::serveMainpage(WebResponse& response)
DomElement::htmlAttributeValue(styleSheets, session_.fixRelativeUrl(url));

if (conf.useScriptNonce()) {
styleSheets << " nonce=\"" << response.nonce() << "\""
<< "></script>\n";
styleSheets << " nonce=\"" << response.nonce() << "\"";
}
styleSheets << "></script>\n";

beforeLoadJS_ << app->scriptLibraries_[i].beforeLoadJS;
}
Expand Down

0 comments on commit 11cda9a

Please sign in to comment.