Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions event.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,11 @@ const (
)

func checkID(id, kind string, sigil byte) (err error) {
if _, err = domainFromID(id); err != nil {
return
if kind != "room" {
// RoomIDs should always be an opaque string, so only do this check for other kinds of ID

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't true though for rooms <v12.

It would be better to assert that the room ID either:

  • has a domain OR
  • is exactly 43 characters of base 64 (we do a similar check in Synapse)

if _, err = domainFromID(id); err != nil {
return
}
}
if id[0] != sigil {
err = fmt.Errorf(
Expand Down