Module: HTTPX::Plugins::Expect::ConnectionMethods

Defined in:
lib/httpx/plugins/expect.rb

Instance Method Summary collapse

Instance Method Details

#send_request_to_parser(request) ⇒ Object



78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# File 'lib/httpx/plugins/expect.rb', line 78

def send_request_to_parser(request)
  super

  return unless request.headers["expect"] == "100-continue"

  expect_timeout = request.options.expect_timeout

  return if expect_timeout.nil? || expect_timeout.infinite?

  set_request_timeout(request, expect_timeout, :expect, %i[body response]) do
    # expect timeout expired
    if request.state == :expect && !request.expects?
      Expect.no_expect_store << request.origin
      request.headers.delete("expect")
      consume
    end
  end
end