mirror of
https://github.com/mastodon/mastodon.git
synced 2024-11-12 18:16:21 +00:00
Fix trying to fetch key from empty URI when verifying HTTP signature (#16100)
This commit is contained in:
parent
422df9d670
commit
f627d2eb93
|
@ -67,7 +67,7 @@ module JsonLdHelper
|
||||||
unless id
|
unless id
|
||||||
json = fetch_resource_without_id_validation(uri, on_behalf_of)
|
json = fetch_resource_without_id_validation(uri, on_behalf_of)
|
||||||
|
|
||||||
return unless json
|
return if !json.is_a?(Hash) || unsupported_uri_scheme?(json['id'])
|
||||||
|
|
||||||
uri = json['id']
|
uri = json['id']
|
||||||
end
|
end
|
||||||
|
|
|
@ -5,6 +5,8 @@ class ActivityPub::FetchRemoteKeyService < BaseService
|
||||||
|
|
||||||
# Returns account that owns the key
|
# Returns account that owns the key
|
||||||
def call(uri, id: true, prefetched_body: nil)
|
def call(uri, id: true, prefetched_body: nil)
|
||||||
|
return if uri.blank?
|
||||||
|
|
||||||
if prefetched_body.nil?
|
if prefetched_body.nil?
|
||||||
if id
|
if id
|
||||||
@json = fetch_resource_without_id_validation(uri)
|
@json = fetch_resource_without_id_validation(uri)
|
||||||
|
|
Loading…
Reference in a new issue