Revert "fix: inefficient method of extracting url from text (#741)" (#748)

* Revert "fix: inefficient method of extracting url from text (#741)"

This reverts commit f5c1affc4d.

* fix: link preview should follow redirects

* fix: allow link preview of URLs with @ sign

---------

Co-authored-by: Ezequiel Moraes <ezequielmoraesdev@gmail.com>
This commit is contained in:
arthur simas
2024-04-29 04:44:42 -03:00
committed by GitHub
parent eb5edddf2f
commit d91967aa1c
2 changed files with 2 additions and 5 deletions

View File

@@ -40,7 +40,6 @@ 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 = /[\w-\.]+@([\w-]+\.)+[\w-]{2,4}/
export const WA_CERT_DETAILS = {
SERIAL: 0,