Skip to content

v0.9.0

Choose a tag to compare

@obakeng-develops obakeng-develops released this 02 Sep 11:40
· 29 commits to main since this release
a73eb67

One seam, so a distribution can add to the layout head without adding to core.

config.x.extension_head_partials

Empty here. A distribution appends a partial name and it renders in <head> after yield :head. It mirrors config.x.extension_stylesheets, which already worked this way.

The reason it exists: analytics. A snippet added to this layout would mean every self-hosted install reporting into somebody else's project, which is not something an MIT file-delivery app should do quietly. A stock install renders no third-party script and its content security policy is unchanged.

A correction

This release also removes extension_script_src and extension_connect_src, which were added and then taken out again before any release carried them.

They could not work. config.content_security_policy evaluates its block when the initializer loads, which is before any engine initializer has run, so the arrays were always empty when read and the policy never gained the origins.

If you build on Campsend and need to widen the policy, mutate it after the fact:

config.after_initialize do |app|
  policy = app.config.content_security_policy
  policy&.script_src(*policy.directives.fetch("script-src", []), "https://example.com")
end

Reading the existing directives back preserves whatever the base policy set.

Full changelog: v0.8.0...v0.9.0