rackup 0.2.2 → 0.2.3

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: a2f461ce1898be20b5206f2e36164aed062a6ce123f283d84400ee8f70eff6af
4
- data.tar.gz: d4f73f7cb37cc02ac841f5e7ceb15abcde390de3cb099872735249878fdcf1e2
3
+ metadata.gz: 23caa71b03397adf9344168de947fca289d1e4df6c577678e8b7fc8285c522e9
4
+ data.tar.gz: e39027a50a3f54eb0928d6cef394f79cdd52c71da06854f2fcf5ba3a5722c083
5
5
  SHA512:
6
- metadata.gz: 75a3501c7a1bcbe1faf527c280259bc582651c6bb205ad5f37328ad22555ae3d8f51f7ef66ca80ba8b6d72c8c62bcea26878a7f284dc6738efe005f40001c039
7
- data.tar.gz: 887ad57cc40e6b4cc97b3476baed14276b37d07588018f874f807ea079d1c586decc5669760e18981e6d5d8497d05fc2d3cad28bdebb84dc4f7a4366b2b81d9e
6
+ metadata.gz: be73868bc8995d73ae90f9e70bc6b8141ff5b0c26276cfcb8c010376cf3b7bdfc97d3836afad0524de61cee8c9cb910f16806becae671569fbb3484702c84e6c
7
+ data.tar.gz: fdad77f1c5b70d027c67a893db852bb825631772854df4bfdfc08d3d5ab2a2c40212375bc318f276695ce659014b7f72a2c80d62b0c0c73a0f6069649f21c845
@@ -93,18 +93,26 @@ module Rackup
93
93
 
94
94
  status, headers, body = @app.call(env)
95
95
  begin
96
- res.status = status.to_i
97
- io_lambda = nil
96
+ res.status = status
97
+
98
+ if value = headers[RACK_HIJACK]
99
+ io_lambda = value
100
+ elsif !body.respond_to?(:to_path) && !body.respond_to?(:each)
101
+ io_lambda = body
102
+ end
103
+
104
+ if value = headers.delete('set-cookie')
105
+ res.cookies.concat(Array(value))
106
+ end
107
+
98
108
  headers.each { |key, value|
99
- if key == RACK_HIJACK
100
- io_lambda = value
101
- elsif key == "set-cookie"
102
- res.cookies.concat(Array(value))
103
- else
104
- # Since WEBrick won't accept repeated headers,
105
- # merge the values per RFC 1945 section 4.2.
106
- res[key] = Array(value).join(", ")
107
- end
109
+ # Skip keys starting with rack., per Rack SPEC
110
+ next if key.start_with?('rack.')
111
+
112
+ # Since WEBrick won't accept repeated headers,
113
+ # merge the values per RFC 1945 section 4.2.
114
+ value = value.join(", ") if Array === value
115
+ res[key] = value
108
116
  }
109
117
 
110
118
  if io_lambda
@@ -21,5 +21,5 @@
21
21
  # THE SOFTWARE.
22
22
 
23
23
  module Rackup
24
- VERSION = "0.2.2"
24
+ VERSION = "0.2.3"
25
25
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rackup
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rack Contributors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-10 00:00:00.000000000 Z
11
+ date: 2022-11-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack