Trim whitespace from open group URLs entered by user.

This commit is contained in:
Ian Macdonald 2021-10-25 20:20:42 +02:00
parent ec3e31d211
commit f72ccea6b6
No known key found for this signature in database
GPG key ID: AE4C20556BA626FA

View file

@ -18,7 +18,7 @@ import { getOpenGroupManager } from './OpenGroupManagerV2';
// 143.198.213.255:80/main?public_key=658d29b91892a2389505596b135e76a53db6e11d613a51dbd3d0816adffb231c
export function parseOpenGroupV2(urlWithPubkey: string): OpenGroupV2Room | undefined {
const lowerCased = urlWithPubkey.toLowerCase();
const lowerCased = urlWithPubkey.trim().toLowerCase();
try {
if (!openGroupV2CompleteURLRegex.test(lowerCased)) {
throw new Error('regex fail');