Skip to content

Commit 2131b85

Browse files
authored
fix: check if the x-return-type header is in request header (#72)
1 parent 14e0353 commit 2131b85

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

plugin/routes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
'action' => function () {
1515
$headers = kirby()->request()->headers();
1616
$formData = kirby()->request()->data();
17-
$shouldReturnJson = ($headers['X-Return-Type'] === 'json');
17+
$shouldReturnJson = (array_key_exists('X-Return-Type', $headers) && $headers['X-Return-Type'] === 'json');
1818

1919
$page = page($formData['pageUuid']);
2020

0 commit comments

Comments
 (0)