Skip to content

Commit

Permalink
fix(sdk): fixed-join-link-parsing (#4114)
Browse files Browse the repository at this point in the history
Co-authored-by: rsarika <95286093+rsarika@users.noreply.github.com>
  • Loading branch information
adhmenon and rsarika authored Feb 27, 2025
1 parent 83d1f72 commit fc8c62a
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
2 changes: 2 additions & 0 deletions packages/@webex/plugin-meetings/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ export const HOST = 'host';

export const JOIN = 'join';

export const JOIN_LINK_MTID = 'MTID';

export const LEAVE = 'leave';
export const LIVE = 'live';
export const LOCAL = 'local';
Expand Down
4 changes: 3 additions & 1 deletion packages/@webex/plugin-meetings/src/meeting-info/utilv2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
UUID_REG,
VALID_EMAIL_ADDRESS,
DEFAULT_MEETING_INFO_REQUEST_BODY,
JOIN_LINK_MTID,
} from '../constants';
import ParameterError from '../common/errors/parameter';
import LoggerProxy from '../common/logs/logger-proxy';
Expand Down Expand Up @@ -70,7 +71,8 @@ export default class MeetingInfoUtil {
parsedUrl.pathname.includes(`/${MEET_M}`) ||
parsedUrl.pathname.includes(`/${MEET_CISCO}`) ||
parsedUrl.pathname.includes(`/${MEET_CO}`) ||
parsedUrl.pathname.includes(`/${JOIN}`));
parsedUrl.pathname.includes(`/${JOIN}`) ||
(parsedUrl.search && parsedUrl.search.includes(JOIN_LINK_MTID)));
}

return hostNameBool && pathNameBool;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -345,5 +345,22 @@ describe('plugin-meetings', () => {
);
});
});

describe('#isMeetingLink', () => {
it('should return true for valid join meeting link with MTID', () => {
const result = MeetingInfoUtil.isMeetingLink('https://cisco.webex.com/cisco/j.php?MTID=m9fe0afd8c435e892afcce9ea25b97046');
expect(result).to.be.true;
});

it('should return true for valid join meeting link without cisco domain', () => {
const result = MeetingInfoUtil.isMeetingLink('https://test.webex.com/test/j.php?MTID=m9fe0afd8c435e892afcce9ea25b97046');
expect(result).to.be.true;
});

it('should return false for an invalid meeting link', () => {
const result = MeetingInfoUtil.isMeetingLink('https://test.webex.com/test/j.php?MiD=m9fe0afd8c435e892afcce9ea25b97046');
expect(result).to.be.false;
});
});
});
});

0 comments on commit fc8c62a

Please sign in to comment.