Skip to content

Commit

Permalink
Use clearer class name in HTTP client
Browse files Browse the repository at this point in the history
We create our own special HTTP request subclass in order to send a GET
request without reading the body but the class name misleadingly says it
is without response (which isn't true).

Rename the class to GetWithoutBody which hopefully makes this a little
clearer.
  • Loading branch information
mudge committed Jul 26, 2017
1 parent 2c0e9b7 commit 38010c9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/embiggen/http_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
require 'net/http'

module Embiggen
class GetWithoutResponse < ::Net::HTTPRequest
class GetWithoutBody < ::Net::HTTPRequest
METHOD = 'GET'.freeze
REQUEST_HAS_BODY = false
RESPONSE_HAS_BODY = false
Expand Down Expand Up @@ -30,7 +30,7 @@ def follow(timeout)
private

def request(timeout)
request = GetWithoutResponse.new(uri.request_uri)
request = GetWithoutBody.new(uri.request_uri)
http.open_timeout = timeout
http.read_timeout = timeout

Expand Down

0 comments on commit 38010c9

Please sign in to comment.