ActivityPub-federated video streaming platform using P2P directly in your web browser
Add check for the author username length
Chocobozzza996fc4abef3
diff --git a/server/helpers/customValidators.js b/server/helpers/customValidators.jsindex 9b982369ee..b95e2b9bb5 100644--- a/server/helpers/customValidators.js+++ b/server/helpers/customValidators.js@@ -19,6 +19,7 @@ function eachIsRemoteVideosAddValid (values) {!isNaN(val.duration) &&val.duration >= 0 &&val.duration < constants.MAXIMUM_VIDEO_DURATION &&+ validator.isLength(val.author, 1, constants.MAXIMUM_AUTHOR_LENGTH) &&validator.isDate(val.createdDate)})}diff --git a/server/initializers/constants.js b/server/initializers/constants.jsindex d87a376d32..78bee5efec 100644--- a/server/initializers/constants.js+++ b/server/initializers/constants.js@@ -9,6 +9,8 @@ let FRIEND_BASE_SCORE = 100// Time to wait between requests to the friendslet INTERVAL = 60000+// Max length of the author username+const MAXIMUM_AUTHOR_LENGTH = 20// 2 hours maximum for the duration of a video (in seconds)let MAXIMUM_VIDEO_DURATION = 7200@@ -44,6 +46,7 @@ module.exports = {API_VERSION: API_VERSION,FRIEND_BASE_SCORE: FRIEND_BASE_SCORE,INTERVAL: INTERVAL,+ MAXIMUM_AUTHOR_LENGTH: MAXIMUM_AUTHOR_LENGTH,MAXIMUM_VIDEO_DURATION: MAXIMUM_VIDEO_DURATION,PAGINATION_COUNT_DEFAULT: PAGINATION_COUNT_DEFAULT,PODS_SCORE: PODS_SCORE,