mirror of
https://github.com/lostisland/faraday.git
synced 2025-10-06 00:03:36 -04:00
fixed Patron hack in case the library is not available
This commit is contained in:
parent
9fc7d7e4c1
commit
4a9405d216
@ -22,12 +22,15 @@ module Faraday
|
||||
|
||||
@app.call env
|
||||
end
|
||||
end
|
||||
|
||||
# HAX: helps but doesn't work completely
|
||||
# https://github.com/toland/patron/issues/34
|
||||
valid_actions = ::Patron::Request::VALID_ACTIONS
|
||||
valid_actions << :patch unless valid_actions.include? :patch
|
||||
valid_actions << :options unless valid_actions.include? :options
|
||||
if loaded? && defined?(::Patron::Request::VALID_ACTIONS)
|
||||
# HAX: helps but doesn't work completely
|
||||
# https://github.com/toland/patron/issues/34
|
||||
::Patron::Request::VALID_ACTIONS.tap do |actions|
|
||||
actions << :patch unless actions.include? :patch
|
||||
actions << :options unless actions.include? :options
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user