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

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

codebymikey created an issue. See original summary.

codebymikey’s picture

Status: Active » Needs review

smustgrave made their first commit to this issue’s fork.

smustgrave’s picture

Status: Needs review » Fixed

I'm fine with this change.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.