Skip to content
Open

hotfix #5143

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 4.23.1 (2025-11-06)

### Fixes

* Hotfix: specify the content type when calling back to Astro with JSON to render an area. This is required starting in Astro 4.9.0 and up, otherwise the request is blocked by CSRF protection. This fix allows [section-template-library](https://apostrophecms.com/extensions/section-template-library) previews to work.

## 4.23.0 (2025-10-30)

### Adds
Expand Down
4 changes: 3 additions & 1 deletion modules/@apostrophecms/area/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,9 @@ module.exports = {
const response = await fetch(`${self.apos.baseUrl}/api/apos-external-front/render-area`, {
method: 'POST',
headers: {
'apos-external-front-key': self.apos.externalFrontKey
'apos-external-front-key': self.apos.externalFrontKey,
// Without this Astro enforces CSRF protection starting in version 4.9.0
'content-type': 'application/json'
},
body: JSON.stringify({
area
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "apostrophe",
"version": "4.23.0",
"version": "4.23.1",
"description": "The Apostrophe Content Management System.",
"main": "index.js",
"scripts": {
Expand Down