Add referer header for Algolia API restriction

Created on 24 January 2023, over 1 year ago
Updated 12 August 2024, about 2 months ago

Problem/Motivation

In order to prevent Drupal run Algolia indexing from dev instance, we need a way to restrict indexing from only the live site.
Algolia provides a feature for API restriction, which can be used to restrict a site to interact with the index by defining a narrow privilege API.
However, this feature requires to set the allow referer in order to work, the site has to send the "referer" header along with the request.
Currently, this module doesn't set the referer header. This patch fixes this by adding adding header, the referer, before sending out the request.

Proposed resolution

Add "referer" header before sending out request.

Feature request
Status

Closed: works as designed

Version

3.0

Component

Code

Created by

🇺🇸United States phuang07 New York

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024