actionpack 4.2.5 → 4.2.11.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of actionpack might be problematic. Click here for more details.
- checksums.yaml +5 -5
- data/CHANGELOG.md +78 -0
- data/lib/abstract_controller/rendering.rb +7 -1
- data/lib/action_controller/metal/http_authentication.rb +6 -1
- data/lib/action_controller/metal/renderers.rb +0 -2
- data/lib/action_dispatch/http/mime_negotiation.rb +5 -1
- data/lib/action_dispatch/http/mime_type.rb +16 -2
- data/lib/action_dispatch/journey/router/utils.rb +1 -1
- data/lib/action_dispatch/middleware/cookies.rb +2 -2
- data/lib/action_dispatch/middleware/static.rb +5 -1
- data/lib/action_dispatch/routing/mapper.rb +5 -4
- data/lib/action_dispatch/routing/route_set.rb +4 -4
- data/lib/action_dispatch/routing/routes_proxy.rb +5 -4
- data/lib/action_dispatch/testing/integration.rb +1 -0
- data/lib/action_pack/gem_version.rb +2 -2
- metadata +9 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 6f66b2bf3de01ffbb228cdb182413c6f0db67c97889118cd7d838192e1caed03
|
4
|
+
data.tar.gz: de433afa32a058562cea4ba9bd53d9adeb5d359e0f1594d033c6d5ae1e55ea2e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d15461d87b2063f0c2267a455457fa1375ffada1b0d8311c9c43cd660934108ad2db34486d2e29124911cfb0a342706319a5be1d6ac65aecf911231d306454e7
|
7
|
+
data.tar.gz: 5e5ee8c7e0efa99a88b1a0f9aceb1e2c9458dce7f4e628ff5fd4f031dabe18b5ea97e3bc1e19f4a302a66f29f559ee650d023677860070aed7f8deee419aebe1
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,81 @@
|
|
1
|
+
## Rails 4.2.11.1 (March 11, 2019) ##
|
2
|
+
|
3
|
+
* No changes.
|
4
|
+
|
5
|
+
|
6
|
+
## Rails 4.2.11 (November 27, 2018) ##
|
7
|
+
|
8
|
+
* No changes.
|
9
|
+
|
10
|
+
|
11
|
+
## Rails 4.2.10 (September 27, 2017) ##
|
12
|
+
|
13
|
+
* Fix regression in behavior of `normalize_path`.
|
14
|
+
|
15
|
+
In Rails 5 there was a change to ensure the encoding of the original string
|
16
|
+
in a path was maintained. This was incorrectly backported to Rails 4.2 which
|
17
|
+
caused a regression.
|
18
|
+
|
19
|
+
*Eileen M. Uchitelle*
|
20
|
+
|
21
|
+
## Rails 4.2.9 (June 26, 2017) ##
|
22
|
+
|
23
|
+
* Use more specific check for :format in route path
|
24
|
+
|
25
|
+
The current check for whether to add an optional format to the path is very lax
|
26
|
+
and will match things like `:format_id` where there are nested resources, e.g:
|
27
|
+
|
28
|
+
``` ruby
|
29
|
+
resources :formats do
|
30
|
+
resources :items
|
31
|
+
end
|
32
|
+
```
|
33
|
+
|
34
|
+
Fix this by using a more restrictive regex pattern that looks for the patterns
|
35
|
+
`(.:format)`, `.:format` or `/` at the end of the path. Note that we need to
|
36
|
+
allow for multiple closing parenthesis since the route may be of this form:
|
37
|
+
|
38
|
+
``` ruby
|
39
|
+
get "/books(/:action(.:format))", controller: "books"
|
40
|
+
```
|
41
|
+
|
42
|
+
This probably isn't what's intended since it means that the default index action
|
43
|
+
route doesn't support a format but we have a test for it so we need to allow it.
|
44
|
+
|
45
|
+
Fixes #28517.
|
46
|
+
|
47
|
+
*Andrew White*
|
48
|
+
|
49
|
+
|
50
|
+
## Rails 4.2.8 (February 21, 2017) ##
|
51
|
+
|
52
|
+
* No changes.
|
53
|
+
|
54
|
+
|
55
|
+
## Rails 4.2.7 (July 12, 2016) ##
|
56
|
+
|
57
|
+
* No changes.
|
58
|
+
|
59
|
+
|
60
|
+
## Rails 4.2.6 (March 07, 2016) ##
|
61
|
+
|
62
|
+
* No changes.
|
63
|
+
|
64
|
+
|
65
|
+
## Rails 4.2.5.2 (February 26, 2016) ##
|
66
|
+
|
67
|
+
* Do not allow render with unpermitted parameter.
|
68
|
+
|
69
|
+
Fixes CVE-2016-2098.
|
70
|
+
|
71
|
+
*Arthur Neves*
|
72
|
+
|
73
|
+
|
74
|
+
## Rails 4.2.5.1 (January 25, 2015) ##
|
75
|
+
|
76
|
+
* No changes.
|
77
|
+
|
78
|
+
|
1
79
|
## Rails 4.2.5 (November 12, 2015) ##
|
2
80
|
|
3
81
|
* `ActionController::TestCase` can teardown gracefully if an error is raised
|
@@ -77,7 +77,13 @@ module AbstractController
|
|
77
77
|
# render "foo/bar" to render :file => "foo/bar".
|
78
78
|
# :api: plugin
|
79
79
|
def _normalize_args(action=nil, options={})
|
80
|
-
if action.
|
80
|
+
if action.respond_to?(:permitted?)
|
81
|
+
if action.permitted?
|
82
|
+
action
|
83
|
+
else
|
84
|
+
raise ArgumentError, "render parameters are not permitted"
|
85
|
+
end
|
86
|
+
elsif action.is_a?(Hash)
|
81
87
|
action
|
82
88
|
else
|
83
89
|
options
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'base64'
|
2
|
+
require 'active_support/security_utils'
|
2
3
|
|
3
4
|
module ActionController
|
4
5
|
# Makes it dead easy to do HTTP Basic, Digest and Token authentication.
|
@@ -68,7 +69,11 @@ module ActionController
|
|
68
69
|
def http_basic_authenticate_with(options = {})
|
69
70
|
before_action(options.except(:name, :password, :realm)) do
|
70
71
|
authenticate_or_request_with_http_basic(options[:realm] || "Application") do |name, password|
|
71
|
-
|
72
|
+
# This comparison uses & so that it doesn't short circuit and
|
73
|
+
# uses `variable_size_secure_compare` so that length information
|
74
|
+
# isn't leaked.
|
75
|
+
ActiveSupport::SecurityUtils.variable_size_secure_compare(name, options[:name]) &
|
76
|
+
ActiveSupport::SecurityUtils.variable_size_secure_compare(password, options[:password])
|
72
77
|
end
|
73
78
|
end
|
74
79
|
end
|
@@ -85,8 +85,6 @@ module ActionController
|
|
85
85
|
# format.csv { render csv: @csvable, filename: @csvable.name }
|
86
86
|
# end
|
87
87
|
# end
|
88
|
-
# To use renderers and their mime types in more concise ways, see
|
89
|
-
# <tt>ActionController::MimeResponds::ClassMethods.respond_to</tt>
|
90
88
|
def self.add(key, &block)
|
91
89
|
define_method(_render_with_renderer_method_name(key), &block)
|
92
90
|
RENDERERS << key.to_sym
|
@@ -61,7 +61,7 @@ module ActionDispatch
|
|
61
61
|
false
|
62
62
|
end
|
63
63
|
|
64
|
-
if params_readable
|
64
|
+
v = if params_readable
|
65
65
|
Array(Mime[parameters[:format]])
|
66
66
|
elsif use_accept_header && valid_accept_header
|
67
67
|
accepts
|
@@ -70,6 +70,10 @@ module ActionDispatch
|
|
70
70
|
else
|
71
71
|
[Mime::HTML]
|
72
72
|
end
|
73
|
+
|
74
|
+
v.select do |format|
|
75
|
+
format.symbol || format.ref == "*/*"
|
76
|
+
end
|
73
77
|
end
|
74
78
|
end
|
75
79
|
|
@@ -23,7 +23,7 @@ module Mime
|
|
23
23
|
|
24
24
|
SET = Mimes.new
|
25
25
|
EXTENSION_LOOKUP = {}
|
26
|
-
LOOKUP =
|
26
|
+
LOOKUP = {}
|
27
27
|
|
28
28
|
class << self
|
29
29
|
def [](type)
|
@@ -146,7 +146,7 @@ module Mime
|
|
146
146
|
end
|
147
147
|
|
148
148
|
def lookup(string)
|
149
|
-
LOOKUP[string]
|
149
|
+
LOOKUP[string] || Type.new(string)
|
150
150
|
end
|
151
151
|
|
152
152
|
def lookup_by_extension(extension)
|
@@ -225,9 +225,12 @@ module Mime
|
|
225
225
|
end
|
226
226
|
end
|
227
227
|
|
228
|
+
attr_reader :hash
|
229
|
+
|
228
230
|
def initialize(string, symbol = nil, synonyms = [])
|
229
231
|
@symbol, @synonyms = symbol, synonyms
|
230
232
|
@string = string
|
233
|
+
@hash = [@string, @synonyms, @symbol].hash
|
231
234
|
end
|
232
235
|
|
233
236
|
def to_s
|
@@ -261,6 +264,13 @@ module Mime
|
|
261
264
|
end
|
262
265
|
end
|
263
266
|
|
267
|
+
def eql?(other)
|
268
|
+
super || (self.class == other.class &&
|
269
|
+
@string == other.string &&
|
270
|
+
@synonyms == other.synonyms &&
|
271
|
+
@symbol == other.symbol)
|
272
|
+
end
|
273
|
+
|
264
274
|
def =~(mime_type)
|
265
275
|
return false if mime_type.blank?
|
266
276
|
regexp = Regexp.new(Regexp.quote(mime_type.to_s))
|
@@ -274,6 +284,10 @@ module Mime
|
|
274
284
|
end
|
275
285
|
|
276
286
|
|
287
|
+
protected
|
288
|
+
|
289
|
+
attr_reader :string, :synonyms
|
290
|
+
|
277
291
|
private
|
278
292
|
|
279
293
|
def to_ary; end
|
@@ -13,7 +13,7 @@ module ActionDispatch
|
|
13
13
|
# normalize_path("") # => "/"
|
14
14
|
# normalize_path("/%ab") # => "/%AB"
|
15
15
|
def self.normalize_path(path)
|
16
|
-
path = "/#{path}"
|
16
|
+
path = "/#{path}".force_encoding(Encoding::UTF_8)
|
17
17
|
path.squeeze!('/')
|
18
18
|
path.sub!(%r{/+\Z}, '')
|
19
19
|
path.gsub!(/(%[a-f0-9]{2})/) { $1.upcase }
|
@@ -311,7 +311,7 @@ module ActionDispatch
|
|
311
311
|
|
312
312
|
handle_options(options)
|
313
313
|
|
314
|
-
if @cookies[name.to_s] != value
|
314
|
+
if @cookies[name.to_s] != value || options[:expires]
|
315
315
|
@cookies[name.to_s] = value
|
316
316
|
@set_cookies[name.to_s] = options
|
317
317
|
@delete_cookies.delete(name.to_s)
|
@@ -506,7 +506,7 @@ module ActionDispatch
|
|
506
506
|
|
507
507
|
@parent_jar = parent_jar
|
508
508
|
@options = options
|
509
|
-
secret = key_generator.generate_key(@options[:encrypted_cookie_salt])
|
509
|
+
secret = key_generator.generate_key(@options[:encrypted_cookie_salt])[0, ActiveSupport::MessageEncryptor.key_len]
|
510
510
|
sign_secret = key_generator.generate_key(@options[:encrypted_signed_cookie_salt])
|
511
511
|
@encryptor = ActiveSupport::MessageEncryptor.new(secret, sign_secret, digest: digest, serializer: ActiveSupport::MessageEncryptor::NullSerializer)
|
512
512
|
end
|
@@ -22,7 +22,7 @@ module ActionDispatch
|
|
22
22
|
|
23
23
|
def match?(path)
|
24
24
|
path = URI.parser.unescape(path)
|
25
|
-
return false unless path
|
25
|
+
return false unless valid_path?(path)
|
26
26
|
|
27
27
|
paths = [path, "#{path}#{ext}", "#{path}/index#{ext}"].map { |v|
|
28
28
|
Rack::Utils.clean_path_info v
|
@@ -86,6 +86,10 @@ module ActionDispatch
|
|
86
86
|
false
|
87
87
|
end
|
88
88
|
end
|
89
|
+
|
90
|
+
def valid_path?(path)
|
91
|
+
path.valid_encoding? && !path.include?("\0")
|
92
|
+
end
|
89
93
|
end
|
90
94
|
|
91
95
|
# This middleware will attempt to return the contents of a file's body from
|
@@ -60,6 +60,7 @@ module ActionDispatch
|
|
60
60
|
|
61
61
|
class Mapping #:nodoc:
|
62
62
|
ANCHOR_CHARACTERS_REGEX = %r{\A(\\A|\^)|(\\Z|\\z|\$)\Z}
|
63
|
+
OPTIONAL_FORMAT_REGEX = %r{(?:\(\.:format\)+|\.:format|/)\Z}
|
63
64
|
|
64
65
|
attr_reader :requirements, :conditions, :defaults
|
65
66
|
attr_reader :to, :default_controller, :default_action, :as, :anchor
|
@@ -110,7 +111,7 @@ module ActionDispatch
|
|
110
111
|
if options_constraints.is_a?(Hash)
|
111
112
|
split_constraints path_params, options_constraints
|
112
113
|
options_constraints.each do |key, default|
|
113
|
-
if URL_OPTIONS.include?(key) && (String === default ||
|
114
|
+
if URL_OPTIONS.include?(key) && (String === default || Integer === default)
|
114
115
|
@defaults[key] ||= default
|
115
116
|
end
|
116
117
|
end
|
@@ -144,7 +145,7 @@ module ActionDispatch
|
|
144
145
|
end
|
145
146
|
|
146
147
|
def optional_format?(path, format)
|
147
|
-
format != false &&
|
148
|
+
format != false && path !~ OPTIONAL_FORMAT_REGEX
|
148
149
|
end
|
149
150
|
|
150
151
|
def normalize_options!(options, formatted, path_params, path_ast, modyoule)
|
@@ -790,8 +791,8 @@ module ActionDispatch
|
|
790
791
|
end
|
791
792
|
|
792
793
|
if options[:constraints].is_a?(Hash)
|
793
|
-
defaults = options[:constraints].select do
|
794
|
-
|
794
|
+
defaults = options[:constraints].select do |k, v|
|
795
|
+
URL_OPTIONS.include?(k) && (v.is_a?(String) || v.is_a?(Integer))
|
795
796
|
end
|
796
797
|
|
797
798
|
(options[:defaults] ||= {}).reverse_merge!(defaults)
|
@@ -1,6 +1,5 @@
|
|
1
1
|
require 'action_dispatch/journey'
|
2
2
|
require 'forwardable'
|
3
|
-
require 'thread_safe'
|
4
3
|
require 'active_support/concern'
|
5
4
|
require 'active_support/core_ext/object/to_query'
|
6
5
|
require 'active_support/core_ext/hash/slice'
|
@@ -26,7 +25,6 @@ module ActionDispatch
|
|
26
25
|
class Dispatcher < Routing::Endpoint
|
27
26
|
def initialize(defaults)
|
28
27
|
@defaults = defaults
|
29
|
-
@controller_class_names = ThreadSafe::Cache.new
|
30
28
|
end
|
31
29
|
|
32
30
|
def dispatcher?; true; end
|
@@ -68,7 +66,7 @@ module ActionDispatch
|
|
68
66
|
private
|
69
67
|
|
70
68
|
def controller_reference(controller_param)
|
71
|
-
const_name =
|
69
|
+
const_name = "#{controller_param.camelize}Controller"
|
72
70
|
ActiveSupport::Dependencies.constantize(const_name)
|
73
71
|
end
|
74
72
|
|
@@ -471,9 +469,11 @@ module ActionDispatch
|
|
471
469
|
return if MountedHelpers.method_defined?(name)
|
472
470
|
|
473
471
|
routes = self
|
472
|
+
helpers = routes.url_helpers
|
473
|
+
|
474
474
|
MountedHelpers.class_eval do
|
475
475
|
define_method "_#{name}" do
|
476
|
-
RoutesProxy.new(routes, _routes_context)
|
476
|
+
RoutesProxy.new(routes, _routes_context, helpers)
|
477
477
|
end
|
478
478
|
end
|
479
479
|
|
@@ -8,8 +8,9 @@ module ActionDispatch
|
|
8
8
|
attr_accessor :scope, :routes
|
9
9
|
alias :_routes :routes
|
10
10
|
|
11
|
-
def initialize(routes, scope)
|
11
|
+
def initialize(routes, scope, helpers)
|
12
12
|
@routes, @scope = routes, scope
|
13
|
+
@helpers = helpers
|
13
14
|
end
|
14
15
|
|
15
16
|
def url_options
|
@@ -19,16 +20,16 @@ module ActionDispatch
|
|
19
20
|
end
|
20
21
|
|
21
22
|
def respond_to?(method, include_private = false)
|
22
|
-
super ||
|
23
|
+
super || @helpers.respond_to?(method)
|
23
24
|
end
|
24
25
|
|
25
26
|
def method_missing(method, *args)
|
26
|
-
if
|
27
|
+
if @helpers.respond_to?(method)
|
27
28
|
self.class.class_eval <<-RUBY, __FILE__, __LINE__ + 1
|
28
29
|
def #{method}(*args)
|
29
30
|
options = args.extract_options!
|
30
31
|
args << url_options.merge((options || {}).symbolize_keys)
|
31
|
-
|
32
|
+
@helpers.#{method}(*args)
|
32
33
|
end
|
33
34
|
RUBY
|
34
35
|
send(method, *args)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: actionpack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.2.
|
4
|
+
version: 4.2.11.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Heinemeier Hansson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-03-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 4.2.
|
19
|
+
version: 4.2.11.1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 4.2.
|
26
|
+
version: 4.2.11.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rack
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -98,28 +98,28 @@ dependencies:
|
|
98
98
|
requirements:
|
99
99
|
- - '='
|
100
100
|
- !ruby/object:Gem::Version
|
101
|
-
version: 4.2.
|
101
|
+
version: 4.2.11.1
|
102
102
|
type: :runtime
|
103
103
|
prerelease: false
|
104
104
|
version_requirements: !ruby/object:Gem::Requirement
|
105
105
|
requirements:
|
106
106
|
- - '='
|
107
107
|
- !ruby/object:Gem::Version
|
108
|
-
version: 4.2.
|
108
|
+
version: 4.2.11.1
|
109
109
|
- !ruby/object:Gem::Dependency
|
110
110
|
name: activemodel
|
111
111
|
requirement: !ruby/object:Gem::Requirement
|
112
112
|
requirements:
|
113
113
|
- - '='
|
114
114
|
- !ruby/object:Gem::Version
|
115
|
-
version: 4.2.
|
115
|
+
version: 4.2.11.1
|
116
116
|
type: :development
|
117
117
|
prerelease: false
|
118
118
|
version_requirements: !ruby/object:Gem::Requirement
|
119
119
|
requirements:
|
120
120
|
- - '='
|
121
121
|
- !ruby/object:Gem::Version
|
122
|
-
version: 4.2.
|
122
|
+
version: 4.2.11.1
|
123
123
|
description: Web apps on Rails. Simple, battle-tested conventions for building and
|
124
124
|
testing MVC web applications. Works with any Rack-compatible server.
|
125
125
|
email: david@loudthinking.com
|
@@ -299,8 +299,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
299
299
|
version: '0'
|
300
300
|
requirements:
|
301
301
|
- none
|
302
|
-
|
303
|
-
rubygems_version: 2.4.5.1
|
302
|
+
rubygems_version: 3.0.1
|
304
303
|
signing_key:
|
305
304
|
specification_version: 4
|
306
305
|
summary: Web-flow and rendering framework putting the VC in MVC (part of Rails).
|