mirror of
https://github.com/HoneyryderChuck/httpx.git
synced 2025-10-04 00:00:37 -04:00
Merge branch 'issue-354' into 'master'
callbacks plugin: propagated callbacks to derived plugins Closes #354 See merge request os85/httpx!401
This commit is contained in:
commit
fb8ebd57d4
@ -32,6 +32,18 @@ module HTTPX
|
||||
MOD
|
||||
end
|
||||
|
||||
def plugin(*args, &blk)
|
||||
super(*args).tap do |sess|
|
||||
CALLBACKS.each do |cb|
|
||||
next unless callbacks_for?(cb)
|
||||
|
||||
sess.callbacks(cb).concat(callbacks(cb))
|
||||
end
|
||||
|
||||
sess.wrap(&blk) if blk
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def branch(options, &blk)
|
||||
|
Loading…
x
Reference in New Issue
Block a user