Use PATCH not POST when enable/disabling toxiproxy#186
Conversation
| def version_string | ||
| return @version_string if @version_string | ||
|
|
||
| version_response = self.class.version |
There was a problem hiding this comment.
Just so i'm understanding this correctly - self.class.version contains a JSON blob that it gets from the server?
There was a problem hiding this comment.
Yeah! It turns out Toxiproxy.version is already exposed. This method will hit the underlying toxiproxy server's /version endpoint and return the result as a string.
toxiproxy-ruby/lib/toxiproxy.rb
Lines 49 to 56 in f281657
That return will be a JSON blob, and while I wanted to parse and extract version from it all there that'd be a breaking change for anyone who is already doing that work. It's probably something we could change in a major release because while folks might be doing that, I think they'd prefer if the library did it for them :D
|
@brendo we should cut a new release with this as last one is over 3 years old 😬 |
Calls to
proxies/{name}are currently going via POST which is triggering log output like:This log is being emitted from Toxiproxy itself:
https://github.com/Shopify/toxiproxy/blob/6caf93523ef11fe7a546457b8d4114a1a634510e/api.go#L296-L300
To remove the log, this PR changes
Toxiproxy.enable/Toxiproxy.disableto usePATCHinstead ofPOST.