Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Pleroma
pleroma
Commits
3d9266a8
Commit
3d9266a8
authored
Nov 17, 2018
by
kaniini
Browse files
federator: do origin containment when processing inbound messages
parent
55640c48
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/pleroma/web/federator/federator.ex
View file @
3d9266a8
...
...
@@ -101,8 +101,11 @@ def handle(:incoming_ap_doc, params) do
params
=
Utils
.
normalize_params
(
params
)
# NOTE: we use the actor ID to do the containment, this is fine because an
# actor shouldn't be acting on objects outside their own AP server.
with
{
:ok
,
_user
}
<-
ap_enabled_actor
(
params
[
"actor"
]),
nil
<-
Activity
.
normalize
(
params
[
"id"
]),
:ok
<-
Transmogrifier
.
contain_origin_from_id
(
params
[
"actor"
],
params
),
{
:ok
,
_activity
}
<-
Transmogrifier
.
handle_incoming
(
params
)
do
else
%
Activity
{}
->
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment