protocol-rack 0.2.5 → 0.2.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 01f7083e192f0a82ca6cf9cb8ff7b11aff04dae2cbe61d792fd7710b17947750
4
- data.tar.gz: 1fcb416ae2acd121010c2d14969db1e0d7849a0dd21849a1cc17f2567ee6bddc
3
+ metadata.gz: 33a02fca6186127b6390f9189b87c312dd05ec7b3351ad31ca75698a30c82097
4
+ data.tar.gz: d58cafc1f71296ed6d68bf09ceeaf945d8ba1785f701623b0139d8f81adb553d
5
5
  SHA512:
6
- metadata.gz: bcd5be7a3aee2b0193055534283baf3b9b347775f61ea25cf412e92fe2d69b0c084c566af18ba38efda9a9b15e5573c6796901da9ef19e163917db76212e2219
7
- data.tar.gz: 682fff0aee179137a373a390b335fd5e7a53b88a216e2fe8eddc95f991adebb568542b702e2644acbabb9ccf4a37bddbe775802d94e35e3a323738dbfd50bced
6
+ metadata.gz: 6460132af99298b1cfb02635af9874050cf6c95c11083a1c6dd5ea884fbe1940d0f3efcea0bfcdbe2040023795bb6ca40046fea8149e55f8c03ca73a76227371
7
+ data.tar.gz: 05ee66f991ad3cd77b4e0937100523c346f2af359ad310591c15286ebccdbad3c01effdb7d79a049aa5f548e595f2c941e69c802e7ed550c75602acf0f48e910
checksums.yaml.gz.sig CHANGED
Binary file
@@ -78,6 +78,12 @@ module Protocol
78
78
  end
79
79
  end
80
80
 
81
+ def make_environment(request)
82
+ {
83
+ request: request
84
+ }
85
+ end
86
+
81
87
  # Build a rack `env` from the incoming request and apply it to the rack middleware.
82
88
  #
83
89
  # @parameter request [Protocol::HTTP::Request] The incoming request.
@@ -86,6 +92,16 @@ module Protocol
86
92
 
87
93
  status, headers, body = @app.call(env)
88
94
 
95
+ # The status must always be an integer.
96
+ unless status.is_a?(Integer)
97
+ raise ArgumentError, "Status must be an integer!"
98
+ end
99
+
100
+ # Headers must always be a hash or equivalent.
101
+ unless headers
102
+ raise ArgumentError, "Headers must not be nil!"
103
+ end
104
+
89
105
  headers, meta = self.wrap_headers(headers)
90
106
 
91
107
  return Response.wrap(env, status, headers, meta, body, request)
@@ -5,6 +5,6 @@
5
5
 
6
6
  module Protocol
7
7
  module Rack
8
- VERSION = "0.2.5"
8
+ VERSION = "0.2.6"
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.2.5
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -38,7 +38,7 @@ cert_chain:
38
38
  Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
39
39
  voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
40
40
  -----END CERTIFICATE-----
41
- date: 2023-06-03 00:00:00.000000000 Z
41
+ date: 2023-06-11 00:00:00.000000000 Z
42
42
  dependencies:
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: protocol-http
metadata.gz.sig CHANGED
@@ -1 +1,2 @@
1
- #�"
1
+ \�I�H���;�jV�%FX�7���o-&�.3�Kl�6*@��11���{;�d�u;���bw��'��|i�ԟ�%��4�cWۼ�9)��1,T
2
+ ��|��Ie���frcs�H��+�ȵv-ymB��(Q �؅*�K����X��gg%�"!=�>9���Ē