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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 14dbe09610211d4f7ea05476089ae7c5a276f62d267dea6f3902bdfbe8ecab6b
4
- data.tar.gz: 12354e0b19330b88a4fe73e5675625b3ae096e6e2db087fc2e8d4167f4c10368
3
+ metadata.gz: 2917b0c6ec8772cd25183ae4023a21bf3e9114f20878986597f2f869855a0022
4
+ data.tar.gz: a75b0cab6913b118a672c9f7eeae02454f557ce2b7032ffb68f8cdd80bf0f326
5
5
  SHA512:
6
- metadata.gz: eee29ac6d6b1f61355b1e802fece0f3d4af51603cfd0dca142ed7846f26059467a8cc08143f4dab9bfcb2fa20f93fd67d7654b23c9898b545761de0b1ea57003
7
- data.tar.gz: f654a6cb49ed589ec844f930bc8dc0edec5c818665183011215b72c7b3dc7619b1726a2ec6ff045fd1914de85592c2697a8b10b45073744cba98124cc6f19dbb
6
+ metadata.gz: 5fa7418e0a9f9af9c17fb64fee506eba9e7082d2c2f27df03f4aa3614278ca5b5a9af8ab9b1c630e55f5cccffbd39ba8b13775e5cdc9e5c77fb76922ae6a92d6
7
+ data.tar.gz: 18d783dea490e15e3181c2c458e729b88b476d3166db34cd379bc0e93bce066f6f42c84180808f639eddd9a8544d56d20adb9360a440a932c8dc9e016853dd24
@@ -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 ||= String.new
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(s)
211
- Utils.unescape(s)
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
@@ -25,7 +25,7 @@ module Rack
25
25
  VERSION
26
26
  end
27
27
 
28
- RELEASE = "3.0.5"
28
+ RELEASE = "3.0.6"
29
29
 
30
30
  # Return the Rack release as a dotted string.
31
31
  def self.release
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.5
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-12 00:00:00.000000000 Z
11
+ date: 2023-03-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest