mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
fix: inefficient method of extracting url from text (#741)
* fix: inefficient method of extracting url from text This fixes the thumbnail error when submitting a Google Maps link. * fix: link preview with redirects
This commit is contained in:
@@ -40,7 +40,7 @@ export const PROTOCOL_VERSION = [5, 2]
|
||||
export const MOBILE_NOISE_HEADER = Buffer.concat([Buffer.from('WA'), Buffer.from(PROTOCOL_VERSION)])
|
||||
/** from: https://stackoverflow.com/questions/3809401/what-is-a-good-regular-expression-to-match-a-url */
|
||||
export const URL_REGEX = /(http(s)?:\/\/.)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/
|
||||
export const URL_EXCLUDE_REGEX = /.*@.*/
|
||||
export const URL_EXCLUDE_REGEX = /[\w-\.]+@([\w-]+\.)+[\w-]{2,4}/
|
||||
|
||||
export const WA_CERT_DETAILS = {
|
||||
SERIAL: 0,
|
||||
|
||||
Reference in New Issue
Block a user