From b235b88fe806232dfc497264fb4a7f3041167aca Mon Sep 17 00:00:00 2001 From: Tangel Date: Wed, 15 Nov 2023 10:10:16 +0000 Subject: [PATCH] update --- src/protocol/context.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/protocol/context.rs b/src/protocol/context.rs index 433f8f3..1d80bcb 100644 --- a/src/protocol/context.rs +++ b/src/protocol/context.rs @@ -26,6 +26,7 @@ use url::Url; /// Default context used in Activitypub const DEFAULT_CONTEXT: &str = "https://www.w3.org/ns/activitystreams"; +const DEFAULT_SECURITY_CONTEXT: &str = "https://w3id.org/security/v1"; /// Wrapper for federated structs which handles `@context` field. #[derive(Serialize, Deserialize, Debug)] @@ -40,7 +41,10 @@ pub struct WithContext { impl WithContext { /// Create a new wrapper with the default Activitypub context. pub fn new_default(inner: T) -> WithContext { - let context = vec![Value::String(DEFAULT_CONTEXT.to_string())]; + let context = vec![ + Value::String(DEFAULT_CONTEXT.to_string()), + Value::String(DEFAULT_SECURITY_CONTEXT.to_string()), + ]; WithContext::new(inner, context) }