actionpack 5.2.1.1 → 5.2.2.rc1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d8dd7ef49b75439112929760673100ff46874e3a3d09eae114b0a12326125b2b
4
- data.tar.gz: b58f0e8afc30c01d6388a4a9711bb2f285f41912d7fae76593ffe8e88f593b44
3
+ metadata.gz: 84f933e1a01289cfe944e71690e8b6e57761b783ffecaaedf163bf2223d044f4
4
+ data.tar.gz: a80740332ed27082ca9fdbf9aef3f609dd6069f3867d3ccefa6989ce6a459f38
5
5
  SHA512:
6
- metadata.gz: b1f519f504ed45f7ccc98f0da841acb161cb8624814ec5f3009212265c28af11a947b0cf2d2b611d36fc7f5de74b7af1d54fde3a7f2611be31c8018e6701974a
7
- data.tar.gz: 7be320600dc25d3231be0d83dd67b20d639f83a4e0e35c60caad31cf3e1b2d541929c32eff988582cd8ddd6d182d147cabb001515f9eee4730d49a4aefa58fb6
6
+ metadata.gz: ff95cc5b118ad463c2a1b6450ecc65241a7c97e1a0952fb712d95b54df4775a770b63d671bef6f2da1495ff2a43bd3af4582f531df648bd4b845f2088efa7c5a
7
+ data.tar.gz: 831ec7b12c505f559903baa3ff74e30e2431df2ff7ded6228fecdb664ed93de75d63598f58b2ce2b4d791f62a8cbcc4277ed4297511adc5e9da64d77b79ac23d
@@ -1,3 +1,48 @@
1
+ ## Rails 5.2.2.rc1 (November 28, 2018) ##
2
+
3
+ * Reset Capybara sessions if failed system test screenshot raising an exception.
4
+
5
+ Reset Capybara sessions if `take_failed_screenshot` raise exception
6
+ in system test `after_teardown`.
7
+
8
+ *Maxim Perepelitsa*
9
+
10
+ * Use request object for context if there's no controller
11
+
12
+ There is no controller instance when using a redirect route or a
13
+ mounted rack application so pass the request object as the context
14
+ when resolving dynamic CSP sources in this scenario.
15
+
16
+ Fixes #34200.
17
+
18
+ *Andrew White*
19
+
20
+ * Apply mapping to symbols returned from dynamic CSP sources
21
+
22
+ Previously if a dynamic source returned a symbol such as :self it
23
+ would be converted to a string implicity, e.g:
24
+
25
+ policy.default_src -> { :self }
26
+
27
+ would generate the header:
28
+
29
+ Content-Security-Policy: default-src self
30
+
31
+ and now it generates:
32
+
33
+ Content-Security-Policy: default-src 'self'
34
+
35
+ *Andrew White*
36
+
37
+ * Fix `rails routes -c` for controller name consists of multiple word.
38
+
39
+ *Yoshiyuki Kinjo*
40
+
41
+ * Call the `#redirect_to` block in controller context.
42
+
43
+ *Steven Peckins*
44
+
45
+
1
46
  ## Rails 5.2.1.1 (November 27, 2018) ##
2
47
 
3
48
  * No changes.
@@ -7,6 +7,7 @@ require "active_support/i18n"
7
7
  module AbstractController
8
8
  extend ActiveSupport::Autoload
9
9
 
10
+ autoload :ActionNotFound, "abstract_controller/base"
10
11
  autoload :Base
11
12
  autoload :Caching
12
13
  autoload :Callbacks
@@ -105,7 +105,7 @@ module ActionController
105
105
  when String
106
106
  request.protocol + request.host_with_port + options
107
107
  when Proc
108
- _compute_redirect_to_location request, options.call
108
+ _compute_redirect_to_location request, instance_eval(&options)
109
109
  else
110
110
  url_for(options)
111
111
  end.delete("\0\r\n")
@@ -22,7 +22,8 @@ module ActionDispatch #:nodoc:
22
22
 
23
23
  if policy = request.content_security_policy
24
24
  nonce = request.content_security_policy_nonce
25
- headers[header_name(request)] = policy.build(request.controller_instance, nonce)
25
+ context = request.controller_instance || request
26
+ headers[header_name(request)] = policy.build(context, nonce)
26
27
  end
27
28
 
28
29
  response
@@ -256,7 +257,8 @@ module ActionDispatch #:nodoc:
256
257
  if context.nil?
257
258
  raise RuntimeError, "Missing context for the dynamic content security policy source: #{source.inspect}"
258
259
  else
259
- context.instance_exec(&source)
260
+ resolved = context.instance_exec(&source)
261
+ resolved.is_a?(Symbol) ? apply_mapping(resolved) : resolved
260
262
  end
261
263
  else
262
264
  raise RuntimeError, "Unexpected content security policy source: #{source.inspect}"
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require "active_support/core_ext/hash/indifferent_access"
4
+
3
5
  module ActionDispatch
4
6
  class Request
5
7
  class Utils # :nodoc:
@@ -84,7 +84,7 @@ module ActionDispatch
84
84
 
85
85
  def normalize_filter(filter)
86
86
  if filter.is_a?(Hash) && filter[:controller]
87
- { controller: /#{filter[:controller].downcase.sub(/_?controller\z/, '').sub('::', '/')}/ }
87
+ { controller: /#{filter[:controller].underscore.sub(/_?controller\z/, "")}/ }
88
88
  elsif filter
89
89
  { controller: /#{filter}/, action: /#{filter}/, verb: /#{filter}/, name: /#{filter}/, path: /#{filter}/ }
90
90
  end
@@ -390,7 +390,7 @@ module ActionDispatch
390
390
  # for root cases, where the latter is the correct one.
391
391
  def self.normalize_path(path)
392
392
  path = Journey::Router::Utils.normalize_path(path)
393
- path.gsub!(%r{/(\(+)/?}, '\1/') unless path =~ %r{^/\(+[^)]+\)$}
393
+ path.gsub!(%r{/(\(+)/?}, '\1/') unless path =~ %r{^/(\(+[^)]+\)){1,}$}
394
394
  path
395
395
  end
396
396
 
@@ -17,8 +17,11 @@ module ActionDispatch
17
17
  end
18
18
 
19
19
  def after_teardown
20
- take_failed_screenshot
21
- Capybara.reset_sessions!
20
+ begin
21
+ take_failed_screenshot
22
+ ensure
23
+ Capybara.reset_sessions!
24
+ end
22
25
  ensure
23
26
  super
24
27
  end
@@ -9,8 +9,8 @@ module ActionPack
9
9
  module VERSION
10
10
  MAJOR = 5
11
11
  MINOR = 2
12
- TINY = 1
13
- PRE = "1"
12
+ TINY = 2
13
+ PRE = "rc1"
14
14
 
15
15
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
16
16
  end
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: 5.2.1.1
4
+ version: 5.2.2.rc1
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: 2018-11-27 00:00:00.000000000 Z
11
+ date: 2018-11-28 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: 5.2.1.1
19
+ version: 5.2.2.rc1
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: 5.2.1.1
26
+ version: 5.2.2.rc1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rack
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -92,28 +92,28 @@ dependencies:
92
92
  requirements:
93
93
  - - '='
94
94
  - !ruby/object:Gem::Version
95
- version: 5.2.1.1
95
+ version: 5.2.2.rc1
96
96
  type: :runtime
97
97
  prerelease: false
98
98
  version_requirements: !ruby/object:Gem::Requirement
99
99
  requirements:
100
100
  - - '='
101
101
  - !ruby/object:Gem::Version
102
- version: 5.2.1.1
102
+ version: 5.2.2.rc1
103
103
  - !ruby/object:Gem::Dependency
104
104
  name: activemodel
105
105
  requirement: !ruby/object:Gem::Requirement
106
106
  requirements:
107
107
  - - '='
108
108
  - !ruby/object:Gem::Version
109
- version: 5.2.1.1
109
+ version: 5.2.2.rc1
110
110
  type: :development
111
111
  prerelease: false
112
112
  version_requirements: !ruby/object:Gem::Requirement
113
113
  requirements:
114
114
  - - '='
115
115
  - !ruby/object:Gem::Version
116
- version: 5.2.1.1
116
+ version: 5.2.2.rc1
117
117
  description: Web apps on Rails. Simple, battle-tested conventions for building and
118
118
  testing MVC web applications. Works with any Rack-compatible server.
119
119
  email: david@loudthinking.com
@@ -293,8 +293,8 @@ homepage: http://rubyonrails.org
293
293
  licenses:
294
294
  - MIT
295
295
  metadata:
296
- source_code_uri: https://github.com/rails/rails/tree/v5.2.1.1/actionpack
297
- changelog_uri: https://github.com/rails/rails/blob/v5.2.1.1/actionpack/CHANGELOG.md
296
+ source_code_uri: https://github.com/rails/rails/tree/v5.2.2.rc1/actionpack
297
+ changelog_uri: https://github.com/rails/rails/blob/v5.2.2.rc1/actionpack/CHANGELOG.md
298
298
  post_install_message:
299
299
  rdoc_options: []
300
300
  require_paths:
@@ -306,9 +306,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
306
306
  version: 2.2.2
307
307
  required_rubygems_version: !ruby/object:Gem::Requirement
308
308
  requirements:
309
- - - ">="
309
+ - - ">"
310
310
  - !ruby/object:Gem::Version
311
- version: '0'
311
+ version: 1.3.1
312
312
  requirements:
313
313
  - none
314
314
  rubyforge_project: