hanami-router 2.0.0.rc1 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/hanami/middleware/body_parser.rb +3 -5
- data/lib/hanami/router/constants.rb +9 -0
- data/lib/hanami/router/version.rb +1 -1
- data/lib/hanami/router.rb +2 -1
- metadata +6 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d1d74dfb9252f6462cb018bd567261aad94f83ea6837bb78f3d597dd9b62d0c5
|
4
|
+
data.tar.gz: 30c7f9425d0ad82d0c3059ed8a2d8fcc5e1a1a11092caf5f725338748451fddc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1f351789e9d4f24ef65cfdb6e19868e56c612b2f222dfd2f250f15bddfdcf00fb9d7146a5b4bd978fa2cf5b067b2dc1a96f9cf0430f028240a4c6543075cd0a1
|
7
|
+
data.tar.gz: 7019f2ef7c57177041495e7614992b117548d5d0eeace16d4784a9dc07b678d1d49e0987a6f750fd51b342cd5b86136fe393cef2d1fa126250a07ff8887bc1fe
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
require "hanami/router/params"
|
4
4
|
require "hanami/middleware/error"
|
5
|
+
require_relative "../router/constants"
|
5
6
|
|
6
7
|
module Hanami
|
7
8
|
module Middleware
|
@@ -27,9 +28,6 @@ module Hanami
|
|
27
28
|
# @api private
|
28
29
|
ROUTER_PARAMS = "router.params"
|
29
30
|
|
30
|
-
# @api private
|
31
|
-
ROUTER_PARSED_BODY = "router.parsed_body"
|
32
|
-
|
33
31
|
# @api private
|
34
32
|
FALLBACK_KEY = "_"
|
35
33
|
|
@@ -47,8 +45,8 @@ module Hanami
|
|
47
45
|
env[RACK_INPUT].rewind # somebody might try to read this stream
|
48
46
|
|
49
47
|
if (parser = @parsers[media_type(env)])
|
50
|
-
env[ROUTER_PARSED_BODY] = parser.parse(body)
|
51
|
-
env[ROUTER_PARAMS] = _symbolize(env[ROUTER_PARSED_BODY])
|
48
|
+
env[Router::ROUTER_PARSED_BODY] = parser.parse(body)
|
49
|
+
env[ROUTER_PARAMS] = _symbolize(env[Router::ROUTER_PARSED_BODY])
|
52
50
|
end
|
53
51
|
|
54
52
|
@app.call(env)
|
data/lib/hanami/router.rb
CHANGED
@@ -10,6 +10,7 @@ module Hanami
|
|
10
10
|
# @since 0.1.0
|
11
11
|
class Router
|
12
12
|
require "hanami/router/version"
|
13
|
+
require "hanami/router/constants"
|
13
14
|
require "hanami/router/errors"
|
14
15
|
require "hanami/router/segment"
|
15
16
|
require "hanami/router/redirect"
|
@@ -919,7 +920,7 @@ module Hanami
|
|
919
920
|
params ||= {}
|
920
921
|
env[PARAMS] ||= {}
|
921
922
|
|
922
|
-
if (input = env[::Rack::RACK_INPUT]) and input.rewind
|
923
|
+
if !env.key?(ROUTER_PARSED_BODY) && (input = env[::Rack::RACK_INPUT]) and input.rewind
|
923
924
|
env[PARAMS].merge!(::Rack::Utils.parse_nested_query(input.read))
|
924
925
|
input.rewind
|
925
926
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hanami-router
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.0
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Luca Guidi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-11-
|
11
|
+
date: 2022-11-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|
@@ -164,6 +164,7 @@ files:
|
|
164
164
|
- lib/hanami/middleware/trie.rb
|
165
165
|
- lib/hanami/router.rb
|
166
166
|
- lib/hanami/router/block.rb
|
167
|
+
- lib/hanami/router/constants.rb
|
167
168
|
- lib/hanami/router/errors.rb
|
168
169
|
- lib/hanami/router/formatter/csv.rb
|
169
170
|
- lib/hanami/router/formatter/human_friendly.rb
|
@@ -194,11 +195,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
194
195
|
version: '3.0'
|
195
196
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
196
197
|
requirements:
|
197
|
-
- - "
|
198
|
+
- - ">="
|
198
199
|
- !ruby/object:Gem::Version
|
199
|
-
version:
|
200
|
+
version: '0'
|
200
201
|
requirements: []
|
201
|
-
rubygems_version: 3.3.
|
202
|
+
rubygems_version: 3.3.7
|
202
203
|
signing_key:
|
203
204
|
specification_version: 4
|
204
205
|
summary: Rack compatible HTTP router for Ruby and Hanami
|