diff options
| author | Owen Jacobson <owen@grimoire.ca> | 2024-10-29 20:44:03 -0400 |
|---|---|---|
| committer | Owen Jacobson <owen@grimoire.ca> | 2024-10-29 20:44:03 -0400 |
| commit | 9010c7feeca8f4e7e501ad474911deaaf7a1a367 (patch) | |
| tree | e2fb736e7923c0d084ee3ebffe03752dc237edfb /src/channel/routes/post.rs | |
| parent | 15311c7bd816a83d0641de6b6bb3c41bb67079db (diff) | |
Restrict channel names, too.
Thankfully, channel creation only happens in one place, so we don't need a state machine for this.
Diffstat (limited to 'src/channel/routes/post.rs')
| -rw-r--r-- | src/channel/routes/post.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/channel/routes/post.rs b/src/channel/routes/post.rs index 810445c..2cf1cc0 100644 --- a/src/channel/routes/post.rs +++ b/src/channel/routes/post.rs @@ -54,6 +54,9 @@ impl IntoResponse for Error { app::CreateError::DuplicateName(_) => { (StatusCode::CONFLICT, error.to_string()).into_response() } + app::CreateError::InvalidName(_) => { + (StatusCode::BAD_REQUEST, error.to_string()).into_response() + } other => Internal::from(other).into_response(), } } |
