junlarsen / league-connect

:electric_plug: Node.js HTTP/1.1, HTTP/2.0 and WebSocket interface to the League of Legends Client APIs
https://www.npmjs.com/package/league-connect
MIT License
156 stars 24 forks source link

fix: password regex #103

Closed kuwoyuki closed 1 year ago

kuwoyuki commented 1 year ago

fix the password regex pattern, \w-_ creates an invalid range sequence and \w meta already contains an underscore _ previous pattern caused this match:

{
  password: 'mZ5jOHcnfEWSaEcS6C10og--respawn-command',
  ...rest
}

https://github.com/matsjla/league-connect/issues/85

junlarsen commented 1 year ago

Hi, thank you so much for the contribution!

From what I can tell, the new regular expression also appears to match the bad string image

Maybe I am testing it wrong? Please let me know what you tried to match!

kuwoyuki commented 1 year ago

Hi, thank you so much for the contribution!

From what I can tell, the new regular expression also appears to match the bad string image

Maybe I am testing it wrong? Please let me know what you tried to match!

yeah, good catch, i somehow missed that case, the regex will fail if there's a boolean arg after the --remoting-auth-token so it would break if they shuffled the arg order. Adding a lazy quantifier and only matching a char after -- fixes it. Handles white space as well if you switch to rawStdoud in the future. 20230305-024236

junlarsen commented 1 year ago

Sorry for the delay! These changes are now published under 6.0.0-rc11 https://www.npmjs.com/package/league-connect?activeTab=versions