Skip to content

Commit 27aff93

Browse files
committed
Use PATCH not POST when enable/disabling toxiproxy
1 parent 5cd0744 commit 27aff93

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/toxiproxy.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ def down(&block)
212212

213213
# Disables a Toxiproxy. This will drop all active connections and stop the proxy from listening.
214214
def disable
215-
request = Net::HTTP::Post.new("/proxies/#{name}")
215+
request = Net::HTTP::Patch.new("/proxies/#{name}")
216216
request["Content-Type"] = "application/json"
217217

218218
hash = { enabled: false }
@@ -225,7 +225,7 @@ def disable
225225

226226
# Enables a Toxiproxy. This will cause the proxy to start listening again.
227227
def enable
228-
request = Net::HTTP::Post.new("/proxies/#{name}")
228+
request = Net::HTTP::Patch.new("/proxies/#{name}")
229229
request["Content-Type"] = "application/json"
230230

231231
hash = { enabled: true }

0 commit comments

Comments
 (0)