This project is not covered by Drupal’s security advisory policy.

REST Absolute URLs is a tiny module which replaces relative file / image URLs with absolute URLs in the content fields when they are exposed to any Headless D8 successor (like JSON API or any other).

Usage Example

Imagine you've got a textarea field with WYSIWYG. You upload an image through WYSIWYG and it works great: you can see this image when you check this node in Drupal. However, when this node is getting fetched and displayed by any Frontend Framework (like React.js, Angular, etc), then this image is not visible. That's because the image's URL is relative, and can't be found on a server with your Frontend Framework.

This module automatically replaces such relative internal URLs with absolute URLs, so they point to the right server with Drupal where the files are really located.

Known issues

There's a known issue with the domain name when using Docker and server side rendering with node.js. The problem is that Drupal tries to determine the domain name automatically, and when node.js server makes HTTP request to Drupal using the container name instead of real URL (something like http://nginx/), then Drupal will use the container name as a base URL instead of real URL. The solution for this is to set the base URL explicitly:

  $config['rest_absolute_urls']['base_url'] = '';

Project information

  • caution Minimally maintained
    Maintainers monitor issues, but fast responses are not guaranteed.
  • caution Maintenance fixes only
    Considered feature-complete by its maintainers.
  • chart icon15 sites report using this module
  • shield alertThis project is not covered by the security advisory policy.
    Use at your own risk! It may have publicly disclosed vulnerabilities.