protocol-rack 0.3.1 → 0.4.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
  SHA256:
3
- metadata.gz: 698f8f014b44c23f6f975059abff65a0baa7c237c5e6e396fac1a3da3ad47a9d
4
- data.tar.gz: b90f97e4ead49e5741505f08781f8684dc38ed9f3307aa94535cf734549a9aef
3
+ metadata.gz: a51b0412866f66870722a8f62008d4e76df2ba1d613af62b94eea1a30618bd97
4
+ data.tar.gz: 0cc84245f1dbb289cb1081f4c7c291a0bb3d69498b2d822290937418af7dc532
5
5
  SHA512:
6
- metadata.gz: ca48e4164ec6e0100add61bccdde2022d4eb7e3913481e8f688baab5799bbc2266a1188d9f0f1813af259ec88548f814e25e0ec4f0ef159421103365766857e2
7
- data.tar.gz: b8e71d453c0ff35b2542c9483cd1fd0d17216934a4f4dda27d2ab6c2b516a65edfa7d7a9dcd00775cdbe4e85cbe16973ba380723e04c80734070ca8196136b82
6
+ metadata.gz: ed7a6592a103ecc2f285aa51a83427f29b15fe95cd7488ce57f59878598b833765774db65c5f8563d67e2ac7fe1da01a5f6c58dda6c0e09b34cbdc5fa12d5384
7
+ data.tar.gz: 8182ea7a512bec710d122cdf5ee4f4538b263ef03d2b7eb99130102126c536a58cd2057cf986a9336cad9169eabcffe61ed3c9560d912445a980cdc384311ee8
checksums.yaml.gz.sig CHANGED
Binary file
@@ -73,6 +73,11 @@ module Protocol
73
73
  env[CGI::HTTP_UPGRADE] = Array(protocol).join(",")
74
74
  end
75
75
 
76
+ if request.respond_to?(:hijack?) and request.hijack?
77
+ env[RACK_IS_HIJACK] = true
78
+ env[RACK_HIJACK] = proc{request.hijack!.io.dup}
79
+ end
80
+
76
81
  # HTTP/2 prefers `:authority` over `host`, so we do this for backwards compatibility.
77
82
  env[CGI::HTTP_HOST] ||= request.authority
78
83
 
@@ -17,9 +17,6 @@ module Protocol
17
17
  RACK_MULTIPROCESS = 'rack.multiprocess'
18
18
  RACK_RUN_ONCE = 'rack.run_once'
19
19
 
20
- RACK_IS_HIJACK = 'rack.hijack?'
21
- RACK_HIJACK = 'rack.hijack'
22
-
23
20
  def self.wrap(app)
24
21
  Rewindable.new(self.new(app))
25
22
  end
@@ -36,5 +36,9 @@ module Protocol
36
36
  RACK_URL_SCHEME = 'rack.url_scheme'
37
37
  RACK_PROTOCOL = 'rack.protocol'
38
38
  RACK_RESPONSE_FINISHED = 'rack.response_finished'
39
+
40
+ # Rack hijack support:
41
+ RACK_IS_HIJACK = 'rack.hijack?'
42
+ RACK_HIJACK = 'rack.hijack'
39
43
  end
40
44
  end
@@ -5,6 +5,6 @@
5
5
 
6
6
  module Protocol
7
7
  module Rack
8
- VERSION = "0.3.1"
8
+ VERSION = "0.4.1"
9
9
  end
10
10
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: protocol-rack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
metadata.gz.sig CHANGED
Binary file