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

[Enhance]: append CSP after meta charset please? #7

Closed
1 task done
gacallea opened this issue May 27, 2022 · 5 comments
Closed
1 task done

[Enhance]: append CSP after meta charset please? #7

gacallea opened this issue May 27, 2022 · 5 comments
Assignees
Labels

Comments

@gacallea
Copy link

gacallea commented May 27, 2022

Hi :)

Thanks for this plugin! Even if it is at an early stage, it looks promising. :)

Prerequisites

  • I have searched through existing issues

Feature Request

Currently, the plugin injects CSP directives at the top of the <head>. This moves <meta charset="UTF-8" /> further down and could potentially break its meaning, scope, and functionality.

Since CSP isn't going to suffer from it, I would suggest injecting it right after said meta by default (or even later by using 'head' instead of 'head-prepend')

Cheers and keep up the good work :)

Please and thank you

@gacallea
Copy link
Author

Hi :)

Just adding a note on breakage: it does happen, with projects with more complexity (e.g: more info to add to the CSP). The <meta charset="UTF-8" /> moves too far in the file resulting in the Charset declaration is missing or occurs too late in the HTML error.

Thank you 👍

@josh-hemphill
Copy link
Owner

josh-hemphill commented May 31, 2022

Are you using the most recent release? There was a release about 10 days ago that should have solved this. v1.1.1 is the latest

@gacallea
Copy link
Author

gacallea commented Jun 1, 2022

Are you using the most recent release? There was a release about 10 days ago that should have solved this. v1.1.1 is the latest

Hi :)

1.1.1 seems to do the trick, thanks!

Out of curiosity: what would it take to inject CSP rules after existing meta tags? Or, at the very least, after the charset one?

Cheers!

github-actions bot pushed a commit that referenced this issue Jun 1, 2022
## [1.1.2](v1.1.1...v1.1.2) (2022-06-01)

### Bug Fixes

* 🐛 html tag location in head ([fc939b2](fc939b2)), closes [#7](#7)
@github-actions
Copy link

github-actions bot commented Jun 1, 2022

🎉 This issue has been resolved in version 1.1.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

@josh-hemphill
Copy link
Owner

Yeah, the change in where the tags are injected was supposed to be changed in 1.1.1, but I think I must have just forgotten to make the change. The new version 1.1.2 should fix it.

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

No branches or pull requests

2 participants