Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
synapse
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maunium
synapse
Commits
bd918570
Commit
bd918570
authored
7 years ago
by
Richard van der Hoff
Browse files
Options
Downloads
Patches
Plain Diff
Check missing fields in event_from_pdu_json
Return a 400 rather than a 500 when somebody messes up their send_join
parent
3079f80d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
synapse/federation/federation_base.py
+7
-0
7 additions, 0 deletions
synapse/federation/federation_base.py
with
7 additions
and
0 deletions
synapse/federation/federation_base.py
+
7
−
0
View file @
bd918570
...
@@ -18,6 +18,7 @@ from synapse.api.errors import SynapseError
...
@@ -18,6 +18,7 @@ from synapse.api.errors import SynapseError
from
synapse.crypto.event_signing
import
check_event_content_hash
from
synapse.crypto.event_signing
import
check_event_content_hash
from
synapse.events
import
FrozenEvent
from
synapse.events
import
FrozenEvent
from
synapse.events.utils
import
prune_event
from
synapse.events.utils
import
prune_event
from
synapse.http.servlet
import
assert_params_in_request
from
synapse.util
import
unwrapFirstError
,
logcontext
from
synapse.util
import
unwrapFirstError
,
logcontext
from
twisted.internet
import
defer
from
twisted.internet
import
defer
...
@@ -181,7 +182,13 @@ def event_from_pdu_json(pdu_json, outlier=False):
...
@@ -181,7 +182,13 @@ def event_from_pdu_json(pdu_json, outlier=False):
Returns:
Returns:
FrozenEvent
FrozenEvent
Raises:
SynapseError: if the pdu is missing required fields
"""
"""
# we could probably enforce a bunch of other fields here (room_id, sender,
# origin, etc etc)
assert_params_in_request
(
pdu_json
,
(
'
event_id
'
,
'
type
'
))
event
=
FrozenEvent
(
event
=
FrozenEvent
(
pdu_json
pdu_json
)
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment