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

(bug) isSSL regex is NOT doing what you think it's doing. #1636

Open
WORMSS opened this issue May 6, 2023 · 1 comment
Open

(bug) isSSL regex is NOT doing what you think it's doing. #1636

WORMSS opened this issue May 6, 2023 · 1 comment

Comments

@WORMSS
Copy link

WORMSS commented May 6, 2023

isSSL = /^https|wss/;

/^https|wss/.test("httpstuff") // true
/^https|wss/.test("cowss") // true

I assume you either way

- /^https|wss/
+ /^https:$|^wss:$/
or
+ /^(?:https|wss):$/
or if you don't mind the creation of a capturing group, it makes it easier to read
+ /^(https|wss):$/
@WORMSS
Copy link
Author

WORMSS commented Jun 26, 2023

Is this package not maintained at all?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant