Callbacks removed after adding new options
I would expect options on the httpx instance to be chainable. Some options like callbacks are unexpectedly removed when options are added afterwards.
# irb, httpx 1.4.4
require 'httpx'
# Correct, callbacks are present
httpx = HTTPX.with(headers: { a: 1 })
httpx = httpx.plugin(:callbacks).on_request_started { puts 'test' }
httpx.instance_variable_get(:@callbacks)
# => {request_started: [#<Proc:0x000000012b933060 (irb):16>]}
# Seemingly incorrect, callbacks removed
httpx = HTTPX.plugin(:callbacks).on_request_started { puts 'test' }
httpx = httpx.with(headers: { a: 1 })
httpx.instance_variable_get(:@callbacks)
# => nil
Edited by Harm de Wit