diff options
author | Mario <mario@mariovavti.com> | 2024-10-12 15:08:29 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2024-10-12 15:08:29 +0000 |
commit | 314443d41e22f5518f02dc39133b34a7c55e6b58 (patch) | |
tree | ee4a4ac19ceb25fc9d45952c15a8b9b53be64191 /Zotlabs | |
parent | e2cfe245b79cb08930c0ba2258c26803361d4b2a (diff) | |
parent | bccac55cf99fd4cd0d21bc1ad5e0ef16a762d74f (diff) | |
download | volse-hubzilla-314443d41e22f5518f02dc39133b34a7c55e6b58.tar.gz volse-hubzilla-314443d41e22f5518f02dc39133b34a7c55e6b58.tar.bz2 volse-hubzilla-314443d41e22f5518f02dc39133b34a7c55e6b58.zip |
Merge branch 'first-tests-for-module-magic' into 'dev'
tests: Add some tests for the Zotlabs\Magic module.
See merge request hubzilla/core!2147
Diffstat (limited to 'Zotlabs')
-rw-r--r-- | Zotlabs/Module/Magic.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Zotlabs/Module/Magic.php b/Zotlabs/Module/Magic.php index 8259f7d39..deda4255d 100644 --- a/Zotlabs/Module/Magic.php +++ b/Zotlabs/Module/Magic.php @@ -40,7 +40,11 @@ class Magic extends Controller { goaway($dest); } - $basepath = $parsed['scheme'] . '://' . $parsed['host'] . (isset($parsed['port']) ? ':' . $parsed['port'] : ''); + $basepath = unparse_url(array_filter( + $parsed, + fn (string $key) => in_array($key, ['scheme', 'host', 'port']), + ARRAY_FILTER_USE_KEY + )); $owapath = SConfig::get($basepath,'system','openwebauth', $basepath . '/owa'); // This is ready-made for a plugin that provides a blacklist or "ask me" before blindly authenticating. @@ -106,7 +110,7 @@ class Magic extends Controller { $headers['Content-Type'] = 'application/x-zot+json' ; $headers['X-Open-Web-Auth'] = random_string(); $headers['Host'] = $parsed['host']; - $headers['(request-target)'] = 'get ' . '/owa'; + $headers['(request-target)'] = 'get /owa'; $headers = HTTPSig::create_sig($headers,$channel['channel_prvkey'], channel_url($channel),true,'sha512'); $redirects = 0; |