Skip to content

Node.js based forum software built for the modern web

test: allow http uris in test mode

Barış Soner Uşaklı2e9417c445ae
diff --git a/src/activitypub/index.js b/src/activitypub/index.js
index 5053f48438..667527aa69 100644
--- a/src/activitypub/index.js
+++ b/src/activitypub/index.js
@@ -214,7 +214,12 @@ ActivityPub.fetchPublicKey = async (uri) => {
}
// Validate URI format
- if (!uri || typeof uri !== 'string' || !uri.startsWith('https://')) {
+ const isValidHttpUri = typeof uri === 'string' &&
+ (
+ uri.startsWith('https://') ||
+ (uri.startsWith('http://') && process.env.CI === 'true')
+ );
+ if (!isValidHttpUri) {
throw new Error('[[error:activitypub.invalid-id]]');
}