0
0
Fork 0

Remove instance variables from helper usage (#24203)

This commit is contained in:
Matt Jankowski 2023-04-23 16:35:54 -04:00 committed by GitHub
parent e1b4eeb636
commit 0a5f0a8b20
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 53 additions and 45 deletions

View file

@ -40,7 +40,7 @@ class ActivityPub::Dereferencer
end
def perform_request(uri, headers: nil)
return if invalid_origin?(uri)
return if non_matching_uri_hosts?(@permitted_origin, uri)
req = Request.new(:get, uri)
@ -57,13 +57,4 @@ class ActivityPub::Dereferencer
end
end
end
def invalid_origin?(uri)
return true if unsupported_uri_scheme?(uri)
needle = Addressable::URI.parse(uri).host
haystack = Addressable::URI.parse(@permitted_origin).host
!haystack.casecmp(needle).zero?
end
end