Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VCR support #170

Open
kaspernj opened this issue Apr 3, 2023 · 0 comments
Open

VCR support #170

kaspernj opened this issue Apr 3, 2023 · 0 comments

Comments

@kaspernj
Copy link
Owner

kaspernj commented Apr 3, 2023

Rails.configuration.to_prepare do
  Http2.class_eval do
    def get(args)
      parsed_args = parse_args(args)

      url_builder = Http2::UrlBuilder.new
      url_builder.host = @args[:host]
      url_builder.path = parsed_args[:url]
      url_builder.port = @args[:port] if @args[:port]
      url_builder.protocol = "https" if ssl?

      url = url_builder.build

      vcr_request = VCR::Request.new("GET", url)

      binding.pry

      response = Http2::Response.new(debug: true, request: request)
    end
  end

  Http2::Connection.class_eval do
    def reconnect
      puts "Http2::Connection disable reconnect"
    end
  end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant