Skip to content

Commit

Permalink
Merge pull request #566 from Baroshem/chore/2.1.3
Browse files Browse the repository at this point in the history
chore(release): 2.1.3
  • Loading branch information
vejja authored Nov 22, 2024
2 parents 5ab0873 + ff19b56 commit 0146182
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/pr-pkg-new.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
name: Publish Approved Pull Requests
on:
workflow_dispatch:
pull_request_review:
types: [submitted]

jobs:
check:
# First, trigger a permissions check on the user approving the pull request.
if: github.event.review.state == 'approved'
if: (github.event_name == 'workflow_dispatch' || github.event.review.state == 'approved')
runs-on: ubuntu-latest
outputs:
has-permissions: ${{ steps.checkPermissions.outputs.require-result }}
Expand Down
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Changelog


## v2.1.3

[compare changes](https://github.com/Baroshem/nuxt-security/compare/v2.1.2...v2.1.3)

### 🩹 Fixes

- #564 resolves issue with element.replace on non-string elements ([#564](https://github.com/Baroshem/nuxt-security/issues/564))

### ❤️ Contributors

- Lawren <[email protected]>

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nuxt-security",
"version": "2.1.2",
"version": "2.1.3",
"license": "MIT",
"type": "module",
"engines": {
Expand Down Expand Up @@ -48,6 +48,7 @@
"dev:preview": "nuxi preview playground",
"dev:docs": "rm -rf dist && cd docs && yarn dev",
"lint": "eslint .",
"release": "yarn lint && yarn test && yarn prepack && changelogen --release && npm publish && git push --follow-tags",
"test": "vitest run --silent",
"test:watch": "vitest watch",
"stackblitz": "cd .stackblitz && yarn && yarn dev"
Expand All @@ -68,6 +69,7 @@
"@nuxt/schema": "^3.11.2",
"@nuxt/test-utils": "^3.12.0",
"@types/node": "^18.18.1",
"changelogen": "^0.5.7",
"eslint": "^8.50.0",
"nuxt": "^3.11.2",
"typescript": "^5.4.5",
Expand Down
4 changes: 4 additions & 0 deletions src/runtime/nitro/plugins/40-cspSsrNonce.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ export default defineNitroPlugin((nitroApp) => {
const sections = ['body', 'bodyAppend', 'bodyPrepend', 'head'] as Section[]
for (const section of sections) {
html[section] = html[section].map((element) => {
// Skip non-string elements
if (typeof element !== 'string') {
return element;
}
// Add nonce to all link tags
element = element.replace(LINK_RE, (match, rest) => {
return `<link nonce="${nonce}"` + rest
Expand Down

0 comments on commit 0146182

Please sign in to comment.