diff --git a/src/Controllers/ShareDraftController.php b/src/Controllers/ShareDraftController.php index 3ea1914..a706af1 100644 --- a/src/Controllers/ShareDraftController.php +++ b/src/Controllers/ShareDraftController.php @@ -177,6 +177,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'));