rundeck-ruby icon indicating copy to clipboard operation
rundeck-ruby copied to clipboard

URL encoding bug

Open dblessing opened this issue 10 years ago • 2 comments

+ gets transformed into ' ' (space) when submitted to Rundeck API.

See the last few comments on https://github.com/criteo-cookbooks/rundeck-server/issues/8

dblessing avatar Feb 19 '15 13:02 dblessing

What I've found so far:

  • Rundeck requires content-type 'application/x-www-form-urlencoded' for the body on the import endpoint.
  • HTTParty, therefore, encodes the data (but the + doesn't get encoded).
  • "The HTML spec defines the query component to be mime type application/x-www-form-urlencoded which is defined as "replace spaces with + and other special characters as in RFC1738"."

Still investigating to see what my options are. If I can find an encoder that will treat this correctly I will see if I can replace/override HTTParty's

dblessing avatar Feb 20 '15 02:02 dblessing

ERB::Util.url_encode fixes the issue. So...where to encode now. Looks like I might be able to pass something via HTTParty options for query_param_normalizer or I can just encode before sending the string

dblessing avatar Feb 20 '15 02:02 dblessing