0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-29 18:22:50 +01:00

modules/federation/send: When origin field is used deny on mismatch.

This commit is contained in:
Jason Volk 2020-01-06 16:31:04 -08:00
parent 94aebfb4bf
commit 94c9152061

View file

@ -141,6 +141,15 @@ handle_put(client &client,
pdu_failures.count()
};
if(origin && origin != request.origin)
throw m::ACCESS_DENIED
{
"txn[%s] originating from '%s' not accepted when relayed by '%s'",
txn_id,
origin,
request.origin,
};
// Don't accept sends to ourself for whatever reason (i.e a 127.0.0.1
// leaked into the target list). This should be a 500 so it's not
// considered success or cached as failure by the sender's state.