Improve federated ID validation (#8372)
* Fix URI not being sufficiently validated with prefetched JSON * Add additional id validation to OStatus documents, when possible
This commit is contained in:
parent
ad41806e53
commit
802cf6a4c5
10 changed files with 122 additions and 9 deletions
|
@ -73,8 +73,10 @@ module JsonLdHelper
|
|||
end
|
||||
end
|
||||
|
||||
def body_to_json(body)
|
||||
body.is_a?(String) ? Oj.load(body, mode: :strict) : body
|
||||
def body_to_json(body, compare_id: nil)
|
||||
json = body.is_a?(String) ? Oj.load(body, mode: :strict) : body
|
||||
return if compare_id.present? && json['id'] != compare_id
|
||||
json
|
||||
rescue Oj::ParseError
|
||||
nil
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue