Use Drupal.url() for the fetched API endpoint

Created on 13 May 2025, 27 days ago

Problem/Motivation

There should be a way to ensure that the API endpoint actually points to the real Drupal endpoint, it currently relies on the current location which might not always be correct.

Letting Drupal.url() generate it allows sites to better control how the URL is constructed.

Steps to reproduce

Have a site with a custom drupalSettings.path.baseUrl that is already an absolute URL, then the endpoint URL no longer works.

Proposed resolution

Rely on Drupal.url() to handle the URL resolving.

Remaining tasks

Provide issue fork.

User interface changes

N/A

Feature request
Status

Active

Version

3.0

Component

Code

Created by

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024