git.gnu.io has moved to IP address 209.51.188.249 -- please double check where you are logging in.

Commit 1edb1bbc authored by mmn's avatar mmn

Claim that we are the URL without index.php/ in webfinger response

parent 893d1173
......@@ -47,6 +47,20 @@ abstract class WebFingerResource
// getUrl failed because no valid URL could be returned, just ignore it
}
// We claim that we are for example https://site.example/user/1 even if the client
// requests https://site.example/index.php/user/1 due to behaviour seen in the wild.
foreach(array_keys($aliases) as $alias) {
try {
// get a "fancy url" version of the alias, even without index.php/
$fancy_url = common_fake_local_fancy_url($alias);
// store this as well so remote sites can be sure we really are the same profile
$aliases[$fancy_url] = true;
} catch (Exception $e) {
// in case we couldn't make a "fake local fancy URL", just continue the foreach-loop
continue;
}
}
// return a unique set of aliases by extracting only the keys
return array_keys($aliases);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment