Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't use cookies and headers when building cache keys for remote content #907

Merged
merged 1 commit into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions html/modules/custom/ghi_content/ghi_content.module
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ function ghi_content_form_ghi_subpages_admin_views_form_alter(array &$form, Form
/**
* Implements hook_form_FORM_ID_alter().
*
* Used to disable fields that automatically populated.
* Used to disable fields that are automatically populated.
*/
function ghi_content_form_node_article_edit_form_alter(array &$form, FormStateInterface $form_state) {
/** @var \Drupal\ghi_content\ContentManager\ArticleManager $article_manager */
Expand All @@ -201,7 +201,7 @@ function ghi_content_form_node_article_edit_form_alter(array &$form, FormStateIn
/**
* Implements hook_form_FORM_ID_alter().
*
* Used to disable fields that automatically populated.
* Used to disable fields that are automatically populated.
*/
function ghi_content_form_node_document_edit_form_alter(array &$form, FormStateInterface $form_state) {
/** @var \Drupal\ghi_content\ContentManager\DocumentManager $article_manager */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,7 @@ public function getArticle() {
}
/** @var \Drupal\ghi_content\RemoteSource\RemoteSourceManager $remote_source_manager */
$remote_source_manager = \Drupal::service('plugin.manager.remote_source');
/** @var \Drupal\ghi_content\RemoteSource\RemoteSourceInterface $remote_source */
$remote_source = $remote_source_manager->createInstance($remote_source_key);
$article_id = $conf['article_select']['article']['article_id'] ?? NULL;
if (!$remote_source || !$article_id) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ public function query($payload) {
];

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