Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

checkST2110: Add stricter a=mid position verification #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion checkST2110.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,12 +294,23 @@ const test_10_83_3 = sdp => {
}
}
let doneOne = false;
let firstMid = false;
for ( let x = 0 ; x < lines.length ; x++ ) {
if (lines[x].startsWith('m=')) {
if (!doneOne) {
errors.push(new Error(`Got to line ${x + 1}, the end of session-level description, without finding the destination group, with reference to RFC 7104.`));
}
break;

if (firstMid == true && !lines[x-1].startsWith('a=mid')) {
errors.push(new Error(`Line ${x+1} "m=" should be preceded by "a=mid" on the previous line" `));
}

firstMid = true;
}
if (x == lines.length-1) {
if (!lines[x].startsWith('a=mid:')) {
errors.push(new Error(`Line ${x+1} - final line should contain a=mid" `));
}
}
if (!lines[x].startsWith('a=group')) {
continue;
Expand Down