rawpython / remi

Python REMote Interface library. Platform independent. In about 100 Kbytes, perfect for your diet.
Apache License 2.0
3.53k stars 403 forks source link

Fix query string REGEX #490

Closed nick-hebi closed 2 years ago

nick-hebi commented 2 years ago

This change would allow for query string values to accept non-alphanumeric characters to conform with https://datatracker.ietf.org/doc/html/rfc3986#section-3.4

nick-hebi commented 2 years ago

Hi,

I have been experimenting with setting up Google OAuth for an app that can upload files to Google Drive. This requires passing a code back to the remi app using the web API.

The web API works properly when query strings only contain regular alphanumeric characters. The issue arises from the fact that the URI standard allows for non-alphanumeric characters in query strings.

To remedy this I suggest changing the following regex from: r"^/*(\w+)\/(\w+)\?{0,1}(\w*\={1}(\w|\.)+\&{0,1})*$" to r"^/*(\w+)\/(\w+)\?{0,1}(\w*\={1}([^&])+\&{0,1})*$"

This would allow the web API to support the full range of query string values.

dddomodossola commented 2 years ago

Thank you a lot ;-)