Sanitise the entire request path
Make sure request bodies are JSONised if they exist
Why?
Previously the library only sanitised the path provided in the options, but the client added a / before interpolating it, which means, there could still be a double / in the request path.
Request bodies were previously required to be passed in as JSON, but this could be done in the base client itself, if a body is provided.
How?
Remove the sanitisation method in the instance.rb file and move it to the base_client.rb file. Construct the entire request path and then sanitise it.
Check if there is a request body and if there is one, then JSONise it.
What?
Sanitise the entire request path Make sure request bodies are JSONised if they exist
Why?
Previously the library only sanitised the path provided in the options, but the client added a
/
before interpolating it, which means, there could still be a double/
in the request path.Request bodies were previously required to be passed in as JSON, but this could be done in the base client itself, if a body is provided.
How?
Remove the sanitisation method in the
instance.rb
file and move it to thebase_client.rb
file. Construct the entire request path and then sanitise it.Check if there is a request body and if there is one, then JSONise it.
CC @pusher/sigsdk