insert_activity,
};
use actix_web::{
- body::AnyBody,
web,
web::{Bytes, BytesMut, Payload},
HttpRequest,
/// Convert the data to json and turn it into an HTTP Response with the correct ActivityPub
/// headers.
-fn create_apub_response<T>(data: &T) -> HttpResponse<AnyBody>
+fn create_apub_response<T>(data: &T) -> HttpResponse
where
T: Serialize,
{
.json(WithContext::new(data))
}
-fn create_json_apub_response(data: serde_json::Value) -> HttpResponse<AnyBody> {
+fn create_json_apub_response(data: serde_json::Value) -> HttpResponse {
HttpResponse::Ok()
.content_type(APUB_JSON_CONTENT_TYPE)
.json(data)
}
-fn create_apub_tombstone_response<T>(data: &T) -> HttpResponse<AnyBody>
+fn create_apub_tombstone_response<T>(data: &T) -> HttpResponse
where
T: Serialize,
{
pub(crate) async fn get_activity(
info: web::Path<ActivityQuery>,
context: web::Data<LemmyContext>,
-) -> Result<HttpResponse<AnyBody>, LemmyError> {
+) -> Result<HttpResponse, LemmyError> {
let settings = context.settings();
let activity_id = Url::parse(&format!(
"{}/activities/{}/{}",