mirror of
https://github.com/rest-client/rest-client.git
synced 2022-11-09 13:49:40 -05:00
Added a check to see if the Patch class already exists in Net::HTTP (then we don't need this monkey patch)
This commit is contained in:
parent
14ab0a89c4
commit
d4ac54bbd6
1 changed files with 4 additions and 2 deletions
|
@ -1,7 +1,8 @@
|
|||
module Net
|
||||
class HTTP
|
||||
class HTTP
|
||||
|
||||
# Adding the patch method (rest-client issue: https://github.com/archiloque/rest-client/issues/79)
|
||||
# Adding the patch method if it doesn't exist (rest-client issue: https://github.com/archiloque/rest-client/issues/79)
|
||||
if !defined?(Net::HTTP::Patch)
|
||||
# Code taken from this commit: https://github.com/ruby/ruby/commit/ab70e53ac3b5102d4ecbe8f38d4f76afad29d37d#lib/net/http.rb
|
||||
class Protocol
|
||||
# Sends a PATCH request to the +path+ and gets a response,
|
||||
|
@ -31,6 +32,7 @@ module Net
|
|||
REQUEST_HAS_BODY = true
|
||||
RESPONSE_HAS_BODY = true
|
||||
end
|
||||
end
|
||||
|
||||
#
|
||||
# Replace the request method in Net::HTTP to sniff the body type
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue