From f1ab5c638179b7553d5a2d3ede758726ea3c5c9f Mon Sep 17 00:00:00 2001 From: berliner Date: Thu, 9 Nov 2023 14:24:41 +0100 Subject: [PATCH] Update headers for graphql requests --- .../src/RemoteSource/RemoteSourceBaseHpcContentModule.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/html/modules/custom/ghi_content/src/RemoteSource/RemoteSourceBaseHpcContentModule.php b/html/modules/custom/ghi_content/src/RemoteSource/RemoteSourceBaseHpcContentModule.php index 5fccc5df2..6edf54193 100644 --- a/html/modules/custom/ghi_content/src/RemoteSource/RemoteSourceBaseHpcContentModule.php +++ b/html/modules/custom/ghi_content/src/RemoteSource/RemoteSourceBaseHpcContentModule.php @@ -208,7 +208,8 @@ public function searchArticlesByTitle($title) { public function query($payload) { $body = '{"query": "query ' . str_replace("\n", " ", addslashes(trim($payload))) . '"}'; $headers = [ - 'Content-type: application/json', + 'Content-type' => 'application/json', + 'Apollo-Require-Preflight' => 'true', ]; if ($basic_auth = $this->getRemoteBasicAuth()) { $headers['Authorization'] = 'Basic ' . base64_encode($basic_auth['user'] . ':' . $basic_auth['pass']);