Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(csp): ensure charset meta at top of head #445

Closed
wants to merge 2 commits into from

Conversation

vejja
Copy link
Collaborator

@vejja vejja commented May 7, 2024

Closes #444

Types of changes

  • Bug fix (a non-breaking change which fixes an issue)
  • New feature (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

Currently we insert the CSP meta tag as the first element, to make sure it is read by the UA as soon as possible.

However the W3C spec for HTML5 mentions that the charset meta tag should be the first in head

This PR ensures that the CSP meta tag is inserted right after the charset meta tag, if it exists.

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes (if not applicable, please state why)

Copy link

vercel bot commented May 7, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
nuxt-security ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 7, 2024 4:05pm

@vejja vejja marked this pull request as ready for review May 7, 2024 16:05
@vejja vejja requested a review from Baroshem May 7, 2024 16:05
@vejja vejja self-assigned this May 7, 2024
Copy link
Owner

@Baroshem Baroshem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!

Let's plan it for the 2.0.0 release :)

@Baroshem Baroshem added this to the 2.0.0 milestone May 8, 2024
@Baroshem Baroshem changed the base branch from main to chore/2.0.0-rc.1 May 10, 2024 06:31
@Baroshem
Copy link
Owner

@vejja could you please resolve conflicts here? They appeared after merging your second (very big) PR :D

@vejja
Copy link
Collaborator Author

vejja commented May 10, 2024

Closing this PR in favour of #449, which is v2 compatible

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move meta charset back to top
2 participants