Skip to content

Commit 8c91749

Browse files
authored
PRO-8571: fix the astro section template library bug introduced in astro 4.9.0 (#5140)
* PRO-8571: fix the astro section template library bug introduced in astro 4.9.0 * version number correct * bad typo
1 parent b5dec7c commit 8c91749

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212

1313
### Fixes
1414

15+
* 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.
16+
1517
## 4.23.0 (2025-10-30)
1618

1719
### 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

0 commit comments

Comments
 (0)