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: allow live reload when zola is in serve mode #144

Merged
merged 1 commit into from
Sep 9, 2023

Conversation

welpo
Copy link
Owner

@welpo welpo commented Sep 9, 2023

TL;DR Live reload now works without conflicting with the existing Content Security Policy.

This PR addresses issue #139, which reported that the live reload feature was not functioning due to the existing Content Security Policy (CSP) settings.

Changes:

Modified the header.html template to conditionally add ws: to the connect-src directive in the Content Security Policy. This is done only when Zola is running in serve mode, ensuring that the security policy remains strict in production.

Additional notes:

This change is backward-compatible and does not affect existing configurations or features, including comment systems like Hyvor Talk and Isso.

@welpo welpo added the bug Something isn't working label Sep 9, 2023
@welpo welpo merged commit 355df55 into main Sep 9, 2023
@welpo welpo deleted the fix/live-reload branch September 9, 2023 20:50
@welpo welpo linked an issue Sep 9, 2023 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Live reload with Content Security Policy
1 participant