async-http 0.49.0 → 0.49.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.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/lib/async/http.rb +2 -0
  3. data/lib/async/http/body.rb +2 -0
  4. data/lib/async/http/body/delayed.rb +2 -0
  5. data/lib/async/http/body/hijack.rb +2 -0
  6. data/lib/async/http/body/slowloris.rb +2 -0
  7. data/lib/async/http/body/stream.rb +2 -0
  8. data/lib/async/http/body/writable.rb +2 -0
  9. data/lib/async/http/client.rb +2 -0
  10. data/lib/async/http/endpoint.rb +4 -2
  11. data/lib/async/http/internet.rb +17 -2
  12. data/lib/async/http/pool.rb +2 -0
  13. data/lib/async/http/protocol.rb +2 -0
  14. data/lib/async/http/protocol/http1.rb +2 -0
  15. data/lib/async/http/protocol/http1/client.rb +2 -0
  16. data/lib/async/http/protocol/http1/connection.rb +2 -0
  17. data/lib/async/http/protocol/http1/request.rb +2 -0
  18. data/lib/async/http/protocol/http1/response.rb +2 -0
  19. data/lib/async/http/protocol/http1/server.rb +2 -0
  20. data/lib/async/http/protocol/http10.rb +2 -0
  21. data/lib/async/http/protocol/http11.rb +2 -0
  22. data/lib/async/http/protocol/http2.rb +2 -0
  23. data/lib/async/http/protocol/http2/client.rb +2 -0
  24. data/lib/async/http/protocol/http2/connection.rb +2 -0
  25. data/lib/async/http/protocol/http2/request.rb +2 -0
  26. data/lib/async/http/protocol/http2/response.rb +2 -0
  27. data/lib/async/http/protocol/http2/server.rb +2 -0
  28. data/lib/async/http/protocol/http2/stream.rb +2 -0
  29. data/lib/async/http/protocol/https.rb +2 -0
  30. data/lib/async/http/protocol/request.rb +2 -0
  31. data/lib/async/http/protocol/response.rb +2 -0
  32. data/lib/async/http/proxy.rb +2 -0
  33. data/lib/async/http/reference.rb +2 -0
  34. data/lib/async/http/server.rb +2 -0
  35. data/lib/async/http/statistics.rb +2 -0
  36. data/lib/async/http/version.rb +3 -1
  37. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6e9889b252683ee3e3a2fdb7e41c776615d88105425d03880dd76ba3a7fa7b4f
4
- data.tar.gz: ff700f16b6f5caa0ebf3d7d48f01ce89d903d5670cf189b6856f25b7238e91ea
3
+ metadata.gz: 234d08278fa38ecca5449b3c94220d956f53c564291fe6a71e5b5152e0f5bace
4
+ data.tar.gz: a60712a3e7483dc7bb60d220b439b6f749f15ca0ca70375d3aa10d1460849168
5
5
  SHA512:
6
- metadata.gz: fefc876e105b822b446527c42cfd909ea9123dc194bd142bf8f4ee7eae92ac71a4ca444532b97ab96de996552ac757dc10403eb4bb8bcfdb286273b092c14b4e
7
- data.tar.gz: 1a64d6556647c666b29d91b012a6826c6cc973683c512437a7255c58d74a03a4c083f22cffa3f4a20e4873bad4f45662437135be3945a1500869d5683b4b094c
6
+ metadata.gz: 63f4a410af4f4d6777f6c1c00ca96855c8d8c6057ae4ce43a2f277798f29bf1385dc2bf7d4a3d1eaa76bb16d260d93cf8da1b1679b83defd46b5c7fb91508817
7
+ data.tar.gz: 136a88be9c5e3de646e7249a905627a1f9621d1218d3f4a36fc522aa31d60278b410262b5c7667dc03ac89dfce40ad7e53978f2d798860f9deef6ab0f74e8bd2
data/lib/async/http.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+ #
1
3
  # Copyright, 2017, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+ #
1
3
  # Copyright, 2018, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+ #
1
3
  # Copyright, 2018, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+ #
1
3
  # Copyright, 2018, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+ #
1
3
  # Copyright, 2018, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+ #
1
3
  # Copyright, 2019, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+ #
1
3
  # Copyright, 2018, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+ #
1
3
  # Copyright, 2017, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+ #
1
3
  # Copyright, 2018, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -126,7 +128,7 @@ module Async
126
128
  buffer = @url.path || "/"
127
129
 
128
130
  if query = @url.query
129
- buffer << "?#{query}"
131
+ buffer = "#{buffer}?#{query}"
130
132
  end
131
133
 
132
134
  return buffer
@@ -197,7 +199,7 @@ module Async
197
199
  end
198
200
 
199
201
  def key
200
- [@url.scheme, @url.userinfo, @url.host, @url.port, @options]
202
+ [@url, @options]
201
203
  end
202
204
 
203
205
  def eql? other
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+ #
1
3
  # Copyright, 2018, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -32,9 +34,10 @@ module Async
32
34
 
33
35
  def call(method, url, headers = [], body = nil)
34
36
  endpoint = Endpoint.parse(url)
37
+ key = host_key(endpoint)
35
38
 
36
- client = @clients.fetch(endpoint) do
37
- @clients[endpoint] = self.client_for(endpoint)
39
+ client = @clients.fetch(key) do
40
+ @clients[key] = self.client_for(endpoint)
38
41
  end
39
42
 
40
43
  body = Body::Buffered.wrap(body)
@@ -58,6 +61,18 @@ module Async
58
61
  self.call(verb, url.to_str, headers, body)
59
62
  end
60
63
  end
64
+
65
+ private
66
+
67
+ def host_key(endpoint)
68
+ url = endpoint.url.dup
69
+
70
+ url.path = ""
71
+ url.fragment = nil
72
+ url.query = nil
73
+
74
+ return url
75
+ end
61
76
  end
62
77
  end
63
78
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+ #
1
3
  # Copyright, 2017, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+ #
1
3
  # Copyright, 2017, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+ #
1
3
  # Copyright, 2017, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+ #
1
3
  # Copyright, 2017, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+ #
1
3
  # Copyright, 2017, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+ #
1
3
  # Copyright, 2018, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+ #
1
3
  # Copyright, 2018, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+ #
1
3
  # Copyright, 2017, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+ #
1
3
  # Copyright, 2018, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+ #
1
3
  # Copyright, 2018, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+ #
1
3
  # Copyright, 2018, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+ #
1
3
  # Copyright, 2018, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+ #
1
3
  # Copyright, 2018, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+ #
1
3
  # Copyright, 2018, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+ #
1
3
  # Copyright, 2018, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+ #
1
3
  # Copyright, 2018, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+ #
1
3
  # Copyright, 2018, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+ #
1
3
  # Copyright, 2017, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+ #
1
3
  # Copyright, 2017, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+ #
1
3
  # Copyright, 2017, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+ #
1
3
  # Copyright, 2019, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+ #
1
3
  # Copyright, 2017, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+ #
1
3
  # Copyright, 2017, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+ #
1
3
  # Copyright, 2018, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+ #
1
3
  # Copyright, 2017, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
4
  #
3
5
  # Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -20,6 +22,6 @@
20
22
 
21
23
  module Async
22
24
  module HTTP
23
- VERSION = "0.49.0"
25
+ VERSION = "0.49.1"
24
26
  end
25
27
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: async-http
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.49.0
4
+ version: 0.49.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-24 00:00:00.000000000 Z
11
+ date: 2019-11-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: async