Skip to content

Commit

Permalink
fix: strf-11673 Wrap nonce into SafeString (#301)
Browse files Browse the repository at this point in the history
  • Loading branch information
jairo-bc authored Mar 14, 2024
1 parent 80059c0 commit 2580ddd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion helpers/nonce.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const factory = globals => {
return function() {
const params = globals.getRequestParams();
if (params && params.security && params.security.nonce) {
return ` nonce="${params.security.nonce}"`;
return new globals.handlebars.SafeString(` nonce="${params.security.nonce}"`);
}
return ''
};
Expand Down
2 changes: 1 addition & 1 deletion spec/helpers/nonce.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe('nonce helper', function () {
runTestCases([
{
input: '{{nonce}}',
output: ' nonce="' + requestParams.security.nonce + '"',
output: ' nonce="' + requestParams.security.nonce + '"',
},
], done);
});
Expand Down

0 comments on commit 2580ddd

Please sign in to comment.