httpsig: improve cache lookups

This commit is contained in:
nobody 2021-10-12 20:25:00 -07:00
parent cdba6ffcc5
commit 8bcde2172d
2 changed files with 4 additions and 3 deletions

View file

@ -329,8 +329,9 @@ class HTTPSig {
static function get_webfinger_key($id,$force = false) {
if (! $force) {
$x = q("select * from xchan left join hubloc on xchan_hash = hubloc_hash where hubloc_addr = '%s' or hubloc_id_url = '%s' order by hubloc_id desc",
$x = q("select * from xchan left join hubloc on xchan_hash = hubloc_hash where ( hubloc_addr = '%s' or hubloc_id_url = '%s' or hubloc_hash = '%s') order by hubloc_id desc",
dbesc(str_replace('acct:','',$id)),
dbesc($id),
dbesc($id)
);
@ -369,7 +370,7 @@ class HTTPSig {
static function get_zotfinger_key($id,$force = false) {
if (! $force) {
$x = q("select * from xchan left join hubloc on xchan_hash = hubloc_hash where hubloc_addr = '%s' or hubloc_id_url = '%s' and hubloc_network = 'zot6' order by hubloc_id desc",
$x = q("select * from xchan left join hubloc on xchan_hash = hubloc_hash where ( hubloc_addr = '%s' or hubloc_id_url = '%s' ) and hubloc_network = 'zot6' order by hubloc_id desc",
dbesc(str_replace('acct:','',$id)),
dbesc($id)
);

View file

@ -1,6 +1,6 @@
from libzot import generate_rsa_keypair, rsa_sign, rsa_verify, base64urlnopad_encode, base64urlnopad_decode
from libzot import *
import re
import json