mirror of
https://github.com/oxen-io/session-open-group-server.git
synced 2023-12-13 20:30:35 +01:00
Fix OR response
This commit is contained in:
parent
6196f553d7
commit
0cf470c8f9
1 changed files with 6 additions and 2 deletions
|
@ -1,7 +1,7 @@
|
|||
use std::convert::TryInto;
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
use warp::{Rejection, reply::Reply, reply::Response};
|
||||
use warp::{Rejection, reply::Reply, reply::Response, http::StatusCode};
|
||||
|
||||
use super::crypto;
|
||||
use super::errors::Error;
|
||||
|
@ -106,7 +106,11 @@ async fn encrypt_response(response: Response, symmetric_key: &[u8]) -> Result<Re
|
|||
}
|
||||
let ciphertext = crypto::encrypt_aes_gcm(&bytes, symmetric_key).await.unwrap();
|
||||
let json = base64::encode(&ciphertext);
|
||||
return Ok(warp::reply::json(&json).into_response());
|
||||
let response = warp::http::Response::builder()
|
||||
.status(StatusCode::OK.as_u16())
|
||||
.body(json)
|
||||
.into_response();
|
||||
return Ok(response);
|
||||
}
|
||||
|
||||
// Utilities
|
||||
|
|
Loading…
Reference in a new issue