trustworthy_attribution - Bounce bad URIs (#37372)

This commit is contained in:
Shlee
2026-03-02 20:33:21 +10:30
committed by GitHub
parent ba8e495631
commit 6ab24de659

View File

@@ -60,6 +60,7 @@ class ActivityPub::FetchRemoteStatusService < BaseService
def trustworthy_attribution?(uri, attributed_to)
return false if uri.nil? || attributed_to.nil?
return false if unsupported_uri_scheme?(uri) || unsupported_uri_scheme?(attributed_to)
Addressable::URI.parse(uri).normalized_host.casecmp(Addressable::URI.parse(attributed_to).normalized_host).zero?
end