node-http-proxy
node-http-proxy copied to clipboard
(bug) isSSL regex is NOT doing what you think it's doing.
trafficstars
https://github.com/http-party/node-http-proxy/blob/9b96cd725127a024dabebec6c7ea8c807272223d/lib/http-proxy/common.js#L7
/^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):$/