nx: detect with requested header
Signed-off-by: Varun Patil <radialapps@gmail.com>pull/685/head
parent
fbee0063ea
commit
089c5298c4
|
@ -413,6 +413,10 @@ class Util
|
||||||
public static function callerIsNative(): bool
|
public static function callerIsNative(): bool
|
||||||
{
|
{
|
||||||
// Should not use IRequest here since this method is called during registration
|
// 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 false !== strpos($_SERVER['HTTP_USER_AGENT'] ?? '', 'MemoriesNative');
|
return false !== strpos($_SERVER['HTTP_USER_AGENT'] ?? '', 'MemoriesNative');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue