rstudio / connectapi

An R package for interacting with the RStudio Connect Server API
https://pkgs.rstudio.com/connectapi/
Other
43 stars 25 forks source link

Query params are not URL encoded #263

Closed tnederlof closed 4 months ago

tnederlof commented 4 months ago

Using the prefix arguement for get_groups() works fine when there are no spaces, however with a space (and certain other symbols) will result in a malformed URL error (URL rejected: Malformed input to a URL function).

client <- connect()
get_groups(client, prefix ="Test Group")

This applies beyond groups, see comments in the issue.

nealrichardson commented 4 months ago

connectapi uses string concatenation or interpolation to assemble query strings, rather than passing query params to httr and letting it handle the URL encoding. Case in point: https://github.com/rstudio/connectapi/blob/main/R/connect.R#L680-L682

I'll fix this, and as many others as I can find.

tnederlof commented 4 months ago

connectapi uses string concatenation or interpolation to assemble query strings, rather than passing query params to httr and letting it handle the URL encoding. Case in point: https://github.com/rstudio/connectapi/blob/main/R/connect.R#L680-L682

I'll fix this, and as many others as I can find.

Thank you! Yes I see it for users as well. I will change the issue to be more broad. https://github.com/rstudio/connectapi/blob/15f49bcba389b616c4ec51717dca993f65fc24bf/R/connect.R#L575