Add conversation-based forwarding for limited visibility statuses through bearcaps
This commit is contained in:
parent
52157fdcba
commit
7cd4ed7d42
26 changed files with 430 additions and 78 deletions
|
@ -49,13 +49,12 @@ module JsonLdHelper
|
|||
!uri.start_with?('http://', 'https://')
|
||||
end
|
||||
|
||||
def same_origin?(url_a, url_b)
|
||||
Addressable::URI.parse(url_a).host.casecmp(Addressable::URI.parse(url_b).host).zero?
|
||||
end
|
||||
|
||||
def invalid_origin?(url)
|
||||
return true if unsupported_uri_scheme?(url)
|
||||
|
||||
needle = Addressable::URI.parse(url).host
|
||||
haystack = Addressable::URI.parse(@account.uri).host
|
||||
|
||||
!haystack.casecmp(needle).zero?
|
||||
unsupported_uri_scheme?(url) || !same_origin?(url, @account.uri)
|
||||
end
|
||||
|
||||
def canonicalize(json)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue