mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-14 07:27:01 +03:00
Don't fail for invalid userID
This commit is contained in:
@@ -342,9 +342,9 @@ export async function postSkipSegments(req: Request, res: Response): Promise<Res
|
|||||||
if (typeof videoID !== 'string') {
|
if (typeof videoID !== 'string') {
|
||||||
invalidFields.push('videoID');
|
invalidFields.push('videoID');
|
||||||
}
|
}
|
||||||
if (typeof userID !== 'string' || userID.length < 30) {
|
if (typeof userID !== 'string' || userID?.length < 30) {
|
||||||
invalidFields.push('userID');
|
invalidFields.push('userID');
|
||||||
if (userID.length < 30) errors.push(`userID must be at least 30 characters long`);
|
if (userID?.length < 30) errors.push(`userID must be at least 30 characters long`);
|
||||||
}
|
}
|
||||||
if (!Array.isArray(segments) || segments.length < 1) {
|
if (!Array.isArray(segments) || segments.length < 1) {
|
||||||
invalidFields.push('segments');
|
invalidFields.push('segments');
|
||||||
|
|||||||
Reference in New Issue
Block a user