fix(nx): detection on server

Signed-off-by: Varun Patil <radialapps@gmail.com>
pull/653/merge
Varun Patil 2023-11-01 14:44:38 -07:00
parent 59ec7119ea
commit 133d167f1a
1 changed files with 2 additions and 5 deletions

View File

@ -370,11 +370,8 @@ class Util
public static function callerIsNative(): bool
{
// Should not use IRequest here since this method is called during registration
if (\array_key_exists('HTTP_X_REQUESTED_WITH', $_SERVER)) {
return 'gallery.memories' === $_SERVER['HTTP_X_REQUESTED_WITH'];
}
return str_contains($_SERVER['HTTP_USER_AGENT'] ?? '', 'MemoriesNative');
return 'gallery.memories' === ($_SERVER['HTTP_X_REQUESTED_WITH'] ?? '')
|| str_contains($_SERVER['HTTP_USER_AGENT'] ?? '', 'MemoriesNative');
}
/**