feat(netlify): add experimental support for static headers#13952
feat(netlify): add experimental support for static headers#13952
Conversation
🦋 Changeset detectedLatest commit: 088b2ae The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
sarah11918
left a comment
There was a problem hiding this comment.
Not a deal breaker, but since this is something a user would enable for the Netlify adapter, it might help to make this one changeset more user-focused (so they know what effect enabling this would have on their project, and why they might want to do it).
Nothing wrong with the original one if that's the only info you want to provide! But I don't think the explanation connects all the dots for them that it could. So, suggestion below (but make it accurate).
ascorbic
left a comment
There was a problem hiding this comment.
Aside from the changeset, this looks good
Co-authored-by: Sarah Rainsberger <5098874+sarah11918@users.noreply.github.com>
Co-authored-by: Sarah Rainsberger <5098874+sarah11918@users.noreply.github.com>
088b2ae to
bfa3773
Compare
…#13952) Co-authored-by: Sarah Rainsberger <5098874+sarah11918@users.noreply.github.com> Co-authored-by: ascorbic <213306+ascorbic@users.noreply.github.com> Co-authored-by: sarah11918 <5098874+sarah11918@users.noreply.github.com>
Changes
This PR adds support for static headers for the Netlify adapter. The initial implementation supports the experimental CSP feature. In the future, this may change, and we will update the documentation as needed.
@astrojs/underscore-redirectsTo implement the feature, I had to make some breaking changes within
underscore-redirects. The package is mostly for internal usage, so we don't have strong documentation and it's mostly for our needs, so the changesets are mostly technical.The functionality for redirects must stay the same.
The printing logic has been removed from
Redirects, instead consumers need to useprintAsRedirectsinstead. The core functionality hasn't changed much, it now accounts for.target, because it's now optional.@astrojs/netlifyThe function that creates
config.jsonis now called in theastro:build:donehook, because we need to collect the static headers from the hookastro:build:generated.The new logic now loops through the new static headers, and if
cpsis enabled, they are added to the finalconfig.json.Testing
Added a new test. Existing tests should still pass.
Docs