Set @context for ActivityStream responder
This commit is contained in:
parent
ea29dd91dc
commit
6df4b70318
@ -69,7 +69,9 @@ impl<T> ActivityStream<T> {
|
|||||||
|
|
||||||
impl<'r, O: Object> Responder<'r> for ActivityStream<O> {
|
impl<'r, O: Object> Responder<'r> for ActivityStream<O> {
|
||||||
fn respond_to(self, request: &Request) -> Result<Response<'r>, Status> {
|
fn respond_to(self, request: &Request) -> Result<Response<'r>, Status> {
|
||||||
serde_json::to_string(&self.0).respond_to(request).map(|r| Response::build_from(r)
|
let mut json = serde_json::to_value(&self.0).map_err(|e| Status::InternalServerError)?;
|
||||||
|
json["@context"] = context();
|
||||||
|
serde_json::to_string(&json).respond_to(request).map(|r| Response::build_from(r)
|
||||||
.raw_header("Content-Type", "application/activity+json")
|
.raw_header("Content-Type", "application/activity+json")
|
||||||
.finalize())
|
.finalize())
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user