diff --git a/src/Controllers/ShareDraftController.php b/src/Controllers/ShareDraftController.php index 03ebacd..370e552 100644 --- a/src/Controllers/ShareDraftController.php +++ b/src/Controllers/ShareDraftController.php @@ -157,7 +157,11 @@ private function getRenderedPageByURL(string $url): HTTPResponse $variables = HTTPRequestBuilder::cleanEnvironment(Environment::getVariables()); $variables['_SERVER']['REQUEST_URI'] = $url; $variables['_SERVER']['REQUEST_METHOD'] = 'GET'; - $variables['_SERVER']['HTTP_USER_AGENT'] = 'CLI'; + $variables['_SERVER']['HTTP_USER_AGENT'] = + isset($variables['_SERVER']['HTTP_USER_AGENT']) && + $variables['_SERVER']['HTTP_USER_AGENT'] + ? $variables['_SERVER']['HTTP_USER_AGENT'] + : 'CLI'; Environment::setVariables($variables);