Skip to content

Commit 1043813

Browse files
committed
hotfix
1 parent 239639a commit 1043813

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## 4.23.1 (2025-11-06)
4+
5+
### Fixes
6+
7+
* 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.
8+
39
## 4.23.0 (2025-10-30)
410

511
### Adds

modules/@apostrophecms/area/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,9 @@ module.exports = {
376376
const response = await fetch(`${self.apos.baseUrl}/api/apos-external-front/render-area`, {
377377
method: 'POST',
378378
headers: {
379-
'apos-external-front-key': self.apos.externalFrontKey
379+
'apos-external-front-key': self.apos.externalFrontKey,
380+
// Without this Astro enforces CSRF protection starting in version 4.9.0
381+
'content-type': 'application/json'
380382
},
381383
body: JSON.stringify({
382384
area

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "apostrophe",
3-
"version": "4.23.0",
3+
"version": "4.23.1",
44
"description": "The Apostrophe Content Management System.",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)