Dereference object URIs in Create and Update messages (#14359)
* Dereference object URIs in Create and Update messages Fixes #14353 Signed-off-by: Thibaut Girka <thib@sitedethib.com> * Refactor, and perform origin check *before* attempting to fetch object Co-authored-by: Fire Demon <firedemon@creature.cafe>
This commit is contained in:
		
							parent
							
								
									a8b6524b43
								
							
						
					
					
						commit
						bcf85b5208
					
				
					 3 changed files with 32 additions and 0 deletions
				
			
		|  | @ -2,6 +2,8 @@ | |||
| 
 | ||||
| class ActivityPub::Activity::Create < ActivityPub::Activity | ||||
|   def perform | ||||
|     dereference_object! | ||||
| 
 | ||||
|     case @object['type'] | ||||
|     when 'EncryptedMessage' | ||||
|       create_encrypted_message | ||||
|  |  | |||
|  | @ -4,6 +4,8 @@ class ActivityPub::Activity::Update < ActivityPub::Activity | |||
|   SUPPORTED_TYPES = %w(Application Group Organization Person Service).freeze | ||||
| 
 | ||||
|   def perform | ||||
|     dereference_object! | ||||
| 
 | ||||
|     if equals_or_includes_any?(@object['type'], SUPPORTED_TYPES) | ||||
|       update_account | ||||
|     elsif equals_or_includes_any?(@object['type'], %w(Question)) | ||||
|  |  | |||
		Reference in a new issue