aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Magic.php
diff options
context:
space:
mode:
Diffstat (limited to 'Zotlabs/Module/Magic.php')
-rw-r--r--Zotlabs/Module/Magic.php8
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;