net_http_unix 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0aae4a297c53e997ac27bbe65c348cf28e90fd92
4
- data.tar.gz: 562f8a14c19f7920d97ae225ccd76bb52db965bc
3
+ metadata.gz: e49d1ff0a9774c1d709d8459d2c1810bd4eade0a
4
+ data.tar.gz: 708215709a1816da72543040c7837327223b7737
5
5
  SHA512:
6
- metadata.gz: d834b15006ec04e2f0430e456251043935b1cee3e126c1b6c8fe748381ef25e937e5254b56eaa1a36dab4dd6ffbf2588d44ec0faac5c795c9aa5e759a3af1d58
7
- data.tar.gz: ee7e6b68aa60e81742a3aa7ff4c97608e2c66c1a8efc6f213fa8a8c781f117080209b186ed4c4b0f1c7c7016b09b6375d29651ef37d105cb4ae0eb766994601b
6
+ metadata.gz: 738aec71832876fb2d2cdbe90e7e657e5f5e04950032f673f5d4d395a85283ea48beefa5c49752a9363c89ba8ce3753abcfab6ed75d098b89ee594beb08a0f90
7
+ data.tar.gz: 242b27aea283444be01c250aca0c053ca2545e88b1a25d04410c9077d7bcb30dd915ede6cef6c3b904edd7b81b9a64e3fa5a0ec5c4a18c8505d2d6e8f884ca33
@@ -1,3 +1,3 @@
1
1
  module NetHttpUnix
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
@@ -9,8 +9,11 @@ class HTTPUnix < Net::HTTP
9
9
  case address
10
10
  when UNIX_REGEXP
11
11
  @socket_type = 'unix'
12
- @address = address.sub(UNIX_REGEXP, '')
13
- @port = nil
12
+ @socket_path = address.sub(UNIX_REGEXP, '')
13
+ # Address and port are set to localhost so the HTTP client constructs
14
+ # a HOST request header nginx will accept.
15
+ @address = 'localhost'
16
+ @port = 80
14
17
  else
15
18
  @socket_type = 'inet'
16
19
  end
@@ -28,8 +31,8 @@ class HTTPUnix < Net::HTTP
28
31
  # connect_unix is an alternative implementation of Net::HTTP#connect specific
29
32
  # to the use case of using a Unix Domain Socket.
30
33
  def connect_unix
31
- D "opening connection to #{conn_address()}..."
32
- s = timeout(@open_timeout) { UNIXSocket.open(conn_address()) }
34
+ D "opening connection to #{@socket_path}..."
35
+ s = timeout(@open_timeout) { UNIXSocket.open(@socket_path) }
33
36
  D "opened"
34
37
  @socket = BufferedIO.new(s)
35
38
  @socket.read_timeout = @read_timeout
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: net_http_unix
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeff McCune
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-23 00:00:00.000000000 Z
11
+ date: 2014-11-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler