Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
conduwuit
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
🥺
conduwuit
Commits
4aead5de
Commit
4aead5de
authored
9 months ago
by
🥺
Browse files
Options
Downloads
Patches
Plain Diff
reflax a couple restrictions on custom room IDs and aliases
Signed-off-by:
strawberry
<
strawberry@puppygock.gay
>
parent
aef25ea1
No related branches found
No related tags found
1 merge request
!419
Mixed stuff
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/api/client_server/room.rs
+0
-16
0 additions, 16 deletions
src/api/client_server/room.rs
with
0 additions
and
16 deletions
src/api/client_server/room.rs
+
0
−
16
View file @
4aead5de
...
...
@@ -900,20 +900,6 @@ async fn room_alias_check(
ErrorKind
::
InvalidParam
,
"Room alias contained spaces which is not a valid room alias."
,
));
}
else
if
room_alias_name
.len
()
>
255
{
// there is nothing spec-wise saying to check the limit of this,
// however absurdly long room aliases are guaranteed to be unreadable or done
// maliciously. there is no reason a room alias should even exceed 100
// characters as is. generally in spec, 255 is matrix's fav number
return
Err
(
Error
::
BadRequest
(
ErrorKind
::
InvalidParam
,
"Room alias is excessively long, clients may not be able to handle this. Please shorten it."
,
));
}
else
if
room_alias_name
.contains
(
'"'
)
{
return
Err
(
Error
::
BadRequest
(
ErrorKind
::
InvalidParam
,
"Room alias contained `
\"
` which is not allowed."
,
));
}
// check if room alias is forbidden
...
...
@@ -979,8 +965,6 @@ fn custom_room_id_check(custom_room_id: &String) -> Result<OwnedRoomId> {
ErrorKind
::
InvalidParam
,
"Custom room ID contained spaces which is not valid."
,
));
}
else
if
custom_room_id
.len
()
>
255
{
return
Err
(
Error
::
BadRequest
(
ErrorKind
::
InvalidParam
,
"Custom room ID is too long."
));
}
let
full_room_id
=
format!
(
"!{}:{}"
,
custom_room_id
,
services
()
.globals.config.server_name
);
...
...
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