From 46fa26502b285213f3438abb1e3bd1482eb55bf5 Mon Sep 17 00:00:00 2001 From: Mario Date: Sat, 9 Mar 2024 20:53:18 +0000 Subject: more work on emojis --- include/network.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'include/network.php') diff --git a/include/network.php b/include/network.php index d41ba198d..a5c14f9d1 100644 --- a/include/network.php +++ b/include/network.php @@ -423,7 +423,7 @@ function json_return_and_die($x, $content_type = 'application/json') { killme(); } -function as_return_and_die($obj, $channel) { +function as_return_and_die($obj, $channel = []) { $ret = Activity::build_packet($obj, $channel); logger('data: ' . jindent($ret), LOGGER_DATA); @@ -433,8 +433,10 @@ function as_return_and_die($obj, $channel) { $headers['Digest'] = HTTPSig::generate_digest_header($ret); $headers['(request-target)'] = strtolower($_SERVER['REQUEST_METHOD']) . ' ' . $_SERVER['REQUEST_URI']; - $h = HTTPSig::create_sig($headers, $channel['channel_prvkey'], channel_url($channel)); - HTTPSig::set_headers($h); + if ($channel) { + $h = HTTPSig::create_sig($headers, $channel['channel_prvkey'], channel_url($channel)); + HTTPSig::set_headers($h); + } echo $ret; killme(); -- cgit v1.2.3