forwards-long-jump / discotron

Modular Discord bot supporting plugins hosted on git repositories
MIT License
3 stars 5 forks source link

Rewrite router._parseURL to not use regex #140

Open RedMser opened 4 years ago

RedMser commented 4 years ago

Manually parsing a URL with regex sounds like a really bad idea, especially for such important code.

We can try using URLSearchParams and the URL object instead.

Blatoy commented 4 years ago

While I agree, I don't know if there is an easier way to do it in JS without using a lib (which probably does the same behind the scenes) to access the following things in the url: <plugin-name>#<controller-name>?<arg-key>=<arg-value>&<arg-2>=<value-2>