Skip to content

Commit 28e49da

Browse files
committed
Don't use cookies and headers when building cache keys for remote content
1 parent e194d50 commit 28e49da

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

html/modules/custom/ghi_content/ghi_content.module

+2-2
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ function ghi_content_form_ghi_subpages_admin_views_form_alter(array &$form, Form
189189
/**
190190
* Implements hook_form_FORM_ID_alter().
191191
*
192-
* Used to disable fields that automatically populated.
192+
* Used to disable fields that are automatically populated.
193193
*/
194194
function ghi_content_form_node_article_edit_form_alter(array &$form, FormStateInterface $form_state) {
195195
/** @var \Drupal\ghi_content\ContentManager\ArticleManager $article_manager */
@@ -201,7 +201,7 @@ function ghi_content_form_node_article_edit_form_alter(array &$form, FormStateIn
201201
/**
202202
* Implements hook_form_FORM_ID_alter().
203203
*
204-
* Used to disable fields that automatically populated.
204+
* Used to disable fields that are automatically populated.
205205
*/
206206
function ghi_content_form_node_document_edit_form_alter(array &$form, FormStateInterface $form_state) {
207207
/** @var \Drupal\ghi_content\ContentManager\DocumentManager $article_manager */

html/modules/custom/ghi_content/src/Plugin/Block/Paragraph.php

+1
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,7 @@ public function getArticle() {
429429
}
430430
/** @var \Drupal\ghi_content\RemoteSource\RemoteSourceManager $remote_source_manager */
431431
$remote_source_manager = \Drupal::service('plugin.manager.remote_source');
432+
/** @var \Drupal\ghi_content\RemoteSource\RemoteSourceInterface $remote_source */
432433
$remote_source = $remote_source_manager->createInstance($remote_source_key);
433434
$article_id = $conf['article_select']['article']['article_id'] ?? NULL;
434435
if (!$remote_source || !$article_id) {

html/modules/custom/ghi_content/src/RemoteSource/RemoteSourceBaseHpcContentModule.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ public function query($payload) {
230230
];
231231

232232
// See if we have a cached version already for this request.
233-
$cache_key = $this->getCacheKey(['url' => $this->getRemoteEndpointUrl()] + $post_args);
233+
$cache_key = $this->getCacheKey(['url' => $this->getRemoteEndpointUrl()] + ['body' => $post_args['body']]);
234234
if (!$this->disableCache && $response = $this->cache($cache_key)) {
235235
// If we have a cached version, use that.
236236
return $response;

0 commit comments

Comments
 (0)