diff --git a/src/Controllers/ShareDraftController.php b/src/Controllers/ShareDraftController.php index 883a228..51870de 100644 --- a/src/Controllers/ShareDraftController.php +++ b/src/Controllers/ShareDraftController.php @@ -179,6 +179,11 @@ private function getRenderedPageByURL(string $url): HTTPResponse Environment::setVariables($variables); + // This extra step required for PHP-FPM/Nginx implementations + Environment::setEnv('REQUEST_URI', $url); + Environment::setEnv('REQUEST_METHOD', 'GET'); + Environment::setEnv('HTTP_USER_AGENT', $variables['_SERVER']['HTTP_USER_AGENT']); + // Health-check prior to creating environment $pageRequest = HTTPRequestBuilder::createFromVariables($variables, @file_get_contents('php://input'));