lib/async/http/endpoint.rb in async-http-0.76.0 vs lib/async/http/endpoint.rb in async-http-0.77.0
- old
+ new
@@ -5,26 +5,26 @@
# Copyright, 2021-2022, by Adam Daniels.
# Copyright, 2024, by Thomas Morgan.
# Copyright, 2024, by Igor Sidorov.
# Copyright, 2024, by Hal Brodigan.
-require 'io/endpoint'
-require 'io/endpoint/host_endpoint'
-require 'io/endpoint/ssl_endpoint'
+require "io/endpoint"
+require "io/endpoint/host_endpoint"
+require "io/endpoint/ssl_endpoint"
-require_relative 'protocol/http'
-require_relative 'protocol/https'
+require_relative "protocol/http"
+require_relative "protocol/https"
module Async
module HTTP
# Represents a way to connect to a remote HTTP server.
class Endpoint < ::IO::Endpoint::Generic
SCHEMES = {
- 'http' => URI::HTTP,
- 'https' => URI::HTTPS,
- 'ws' => URI::WS,
- 'wss' => URI::WSS,
+ "http" => URI::HTTP,
+ "https" => URI::HTTPS,
+ "ws" => URI::WS,
+ "wss" => URI::WSS,
}
def self.parse(string, endpoint = nil, **options)
url = URI.parse(string).normalize
@@ -100,10 +100,10 @@
def address
endpoint.address
end
def secure?
- ['https', 'wss'].include?(self.scheme)
+ ["https", "wss"].include?(self.scheme)
end
def protocol
@options.fetch(:protocol) do
if secure?