rack 3.0.5 → 3.0.6
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of rack might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/lib/rack/query_parser.rb +13 -3
- data/lib/rack/version.rb +1 -1
- data/lib/rack.rb +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2917b0c6ec8772cd25183ae4023a21bf3e9114f20878986597f2f869855a0022
|
4
|
+
data.tar.gz: a75b0cab6913b118a672c9f7eeae02454f557ce2b7032ffb68f8cdd80bf0f326
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5fa7418e0a9f9af9c17fb64fee506eba9e7082d2c2f27df03f4aa3614278ca5b5a9af8ab9b1c630e55f5cccffbd39ba8b13775e5cdc9e5c77fb76922ae6a92d6
|
7
|
+
data.tar.gz: 18d783dea490e15e3181c2c458e729b88b476d3166db34cd379bc0e93bce066f6f42c84180808f639eddd9a8544d56d20adb9360a440a932c8dc9e016853dd24
|
data/lib/rack/query_parser.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'uri'
|
4
|
+
|
3
5
|
module Rack
|
4
6
|
class QueryParser
|
5
7
|
DEFAULT_SEP = /[&] */n
|
@@ -111,6 +113,14 @@ module Rack
|
|
111
113
|
_normalize_params(params, name, v, 0)
|
112
114
|
end
|
113
115
|
|
116
|
+
# This value is used by default when a parameter is missing (nil). This
|
117
|
+
# usually happens when a parameter is specified without an `=value` part.
|
118
|
+
# The default value is an empty string, but this can be overridden by
|
119
|
+
# subclasses.
|
120
|
+
def missing_value
|
121
|
+
String.new
|
122
|
+
end
|
123
|
+
|
114
124
|
private def _normalize_params(params, name, v, depth)
|
115
125
|
raise ParamsTooDeepError if depth >= param_depth_limit
|
116
126
|
|
@@ -145,7 +155,7 @@ module Rack
|
|
145
155
|
|
146
156
|
return if k.empty?
|
147
157
|
|
148
|
-
v ||=
|
158
|
+
v ||= missing_value
|
149
159
|
|
150
160
|
if after == ''
|
151
161
|
if k == '[]' && depth != 0
|
@@ -207,8 +217,8 @@ module Rack
|
|
207
217
|
true
|
208
218
|
end
|
209
219
|
|
210
|
-
def unescape(
|
211
|
-
|
220
|
+
def unescape(string, encoding = Encoding::UTF_8)
|
221
|
+
URI.decode_www_form_component(string, encoding)
|
212
222
|
end
|
213
223
|
|
214
224
|
class Params
|
data/lib/rack/version.rb
CHANGED
data/lib/rack.rb
CHANGED
@@ -41,6 +41,7 @@ module Rack
|
|
41
41
|
autoload :MethodOverride, "rack/method_override"
|
42
42
|
autoload :Mime, "rack/mime"
|
43
43
|
autoload :NullLogger, "rack/null_logger"
|
44
|
+
autoload :QueryParser, "rack/query_parser"
|
44
45
|
autoload :Recursive, "rack/recursive"
|
45
46
|
autoload :Reloader, "rack/reloader"
|
46
47
|
autoload :RewindableInput, "rack/rewindable_input"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Leah Neukirchen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-03-
|
11
|
+
date: 2023-03-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|