lib/miteru/http_client.rb in miteru-0.14.7 vs lib/miteru/http_client.rb in miteru-1.0.0
- old
+ new
@@ -5,11 +5,11 @@
require "uri"
module Miteru
class HTTPClient
DEFAULT_UA = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36"
- URLSCAN_UA = "miteru/#{Miteru::VERSION}"
+ URLSCAN_UA = "miteru/#{Miteru::VERSION}".freeze
attr_reader :ssl_context
def initialize
ctx = OpenSSL::SSL::SSLContext.new
@@ -25,21 +25,21 @@
def head(url, options = {})
options = options.merge default_options
HTTP.follow
- .timeout(3)
- .headers(urlscan_url?(url) ? urlscan_headers : default_headers)
- .head(url, options)
+ .timeout(3)
+ .headers(urlscan_url?(url) ? urlscan_headers : default_headers)
+ .head(url, options)
end
def get(url, options = {})
options = options.merge default_options
HTTP.follow
- .timeout(write: 2, connect: 5, read: 10)
- .headers(urlscan_url?(url) ? urlscan_headers : default_headers)
- .get(url, options)
+ .timeout(write: 2, connect: 5, read: 10)
+ .headers(urlscan_url?(url) ? urlscan_headers : default_headers)
+ .get(url, options)
end
def post(url, options = {})
HTTP.post url, options
end