mirror of
https://github.com/stalwartlabs/mail-server.git
synced 2025-11-09 21:31:12 +08:00
Properly decode undelete account name (fixes #761)
This commit is contained in:
parent
ab77a0aca8
commit
49bce9a3de
1 changed files with 5 additions and 2 deletions
|
|
@ -24,6 +24,7 @@ use utils::{url_params::UrlParams, BlobHash};
|
|||
use crate::{
|
||||
api::{
|
||||
http::{HttpSessionData, ToHttpResponse},
|
||||
management::decode_path_element,
|
||||
HttpRequest, HttpResponse, JsonResponse,
|
||||
},
|
||||
email::ingest::{IngestEmail, IngestSource},
|
||||
|
|
@ -61,11 +62,12 @@ impl JMAP {
|
|||
) -> trc::Result<HttpResponse> {
|
||||
match (path.get(2).copied(), req.method()) {
|
||||
(Some(account_name), &Method::GET) => {
|
||||
let account_name = decode_path_element(account_name);
|
||||
let account_id = self
|
||||
.core
|
||||
.storage
|
||||
.data
|
||||
.get_principal_id(account_name)
|
||||
.get_principal_id(account_name.as_ref())
|
||||
.await?
|
||||
.ok_or_else(|| trc::ResourceEvent::NotFound.into_err())?;
|
||||
let mut deleted = self.core.list_deleted(account_id).await?;
|
||||
|
|
@ -111,11 +113,12 @@ impl JMAP {
|
|||
.into_http_response())
|
||||
}
|
||||
(Some(account_name), &Method::POST) => {
|
||||
let account_name = decode_path_element(account_name);
|
||||
let account_id = self
|
||||
.core
|
||||
.storage
|
||||
.data
|
||||
.get_principal_id(account_name)
|
||||
.get_principal_id(account_name.as_ref())
|
||||
.await?
|
||||
.ok_or_else(|| trc::ResourceEvent::NotFound.into_err())?;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue