Skip to content

Fastly is problematic. #23

Description

@ragnarkurmwunder

The Fastly module fails with ping because the Drupal (89) request is not properly set up, only minimal bootstrap is done.

In the Fastly module, the following update needs to be done:

-    $this->baseUrl = $requestStack->getCurrentRequest()->getHost();
+    $this->baseUrl = ($requestStack->getCurrentRequest() instanceof Request) ? $requestStack->getCurrentRequest()->getHost() : $_SERVER['HTTP_HOST'];

The alternative would be to set up the request ourselves. An example:
https://gist.github.com/jibran/e8d5f17aae6424934a77a16f2513420e

It can be easily tested within the ping code like this:

// Set up the request
...
$baseUrl = $requestStack->getCurrentRequest()->getHost();

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions