actionpack 4.2.8 → 4.2.9.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
  SHA1:
3
- metadata.gz: 42469ddb1692c79021861df1836523862e33430e
4
- data.tar.gz: d60612dcb485b977ff0b839337d771a1d11c41be
3
+ metadata.gz: 0e841eab7dc1deda39efeb67df352266e71fb2b7
4
+ data.tar.gz: 97b7a5e00da2c6c114f0b1abe00538fccc62aabd
5
5
  SHA512:
6
- metadata.gz: a1f20abd182c006e347cd835cebfbf46ca5973e8510e49488bb7b7d599f35c6d3185f455a54bedf47601e48ba680a147b6366a6e907d9367cca9718c66e1d1c3
7
- data.tar.gz: 56aadc387182132fa4908501068f2ff2fd77b35fb9c8cd92bb92b1ccc93563d6f1add5bb2a62984810d832d28a1968039ebf8cecf3ad2b7cc482adda1b2e1ec3
6
+ metadata.gz: 40f9137027de48b4a57193e58fa3654ca054089202346cd0f714640195b2ab6e9f06536ab2a418afc485fac60169bd9390fa12a1f7afaf9ed4c8c11a38d17e08
7
+ data.tar.gz: 3bb2873bf78a83dd2bb053417ad7490518661260b4135dc49271f33daa5e6162150808a8f6a46f750e1bed1c815c9200fd3f3485cb065711f09d12f22639b813
data/CHANGELOG.md CHANGED
@@ -1,3 +1,32 @@
1
+ ## Rails 4.2.9.rc1 (June 13, 2017) ##
2
+
3
+ * Use more specific check for :format in route path
4
+
5
+ The current check for whether to add an optional format to the path is very lax
6
+ and will match things like `:format_id` where there are nested resources, e.g:
7
+
8
+ ``` ruby
9
+ resources :formats do
10
+ resources :items
11
+ end
12
+ ```
13
+
14
+ Fix this by using a more restrictive regex pattern that looks for the patterns
15
+ `(.:format)`, `.:format` or `/` at the end of the path. Note that we need to
16
+ allow for multiple closing parenthesis since the route may be of this form:
17
+
18
+ ``` ruby
19
+ get "/books(/:action(.:format))", controller: "books"
20
+ ```
21
+
22
+ This probably isn't what's intended since it means that the default index action
23
+ route doesn't support a format but we have a test for it so we need to allow it.
24
+
25
+ Fixes #28517.
26
+
27
+ *Andrew White*
28
+
29
+
1
30
  ## Rails 4.2.8 (February 21, 2017) ##
2
31
 
3
32
  * No changes.
@@ -13,11 +13,13 @@ module ActionDispatch
13
13
  # normalize_path("") # => "/"
14
14
  # normalize_path("/%ab") # => "/%AB"
15
15
  def self.normalize_path(path)
16
+ encoding = path.encoding
16
17
  path = "/#{path}"
17
18
  path.squeeze!('/')
18
19
  path.sub!(%r{/+\Z}, '')
19
20
  path.gsub!(/(%[a-f0-9]{2})/) { $1.upcase }
20
- path = '/' if path == ''
21
+ path = "/" if path == "".freeze
22
+ path.force_encoding(encoding)
21
23
  path
22
24
  end
23
25
 
@@ -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
@@ -144,7 +145,7 @@ module ActionDispatch
144
145
  end
145
146
 
146
147
  def optional_format?(path, format)
147
- format != false && !path.include?(':format') && !path.end_with?('/')
148
+ format != false && path !~ OPTIONAL_FORMAT_REGEX
148
149
  end
149
150
 
150
151
  def normalize_options!(options, formatted, path_params, path_ast, modyoule)
@@ -7,8 +7,8 @@ module ActionPack
7
7
  module VERSION
8
8
  MAJOR = 4
9
9
  MINOR = 2
10
- TINY = 8
11
- PRE = nil
10
+ TINY = 9
11
+ PRE = "rc1"
12
12
 
13
13
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
14
14
  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: 4.2.8
4
+ version: 4.2.9.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: 2017-02-21 00:00:00.000000000 Z
11
+ date: 2017-06-13 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.8
19
+ version: 4.2.9.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: 4.2.8
26
+ version: 4.2.9.rc1
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.8
101
+ version: 4.2.9.rc1
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.8
108
+ version: 4.2.9.rc1
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.8
115
+ version: 4.2.9.rc1
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.8
122
+ version: 4.2.9.rc1
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
@@ -294,13 +294,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
294
294
  version: 1.9.3
295
295
  required_rubygems_version: !ruby/object:Gem::Requirement
296
296
  requirements:
297
- - - ">="
297
+ - - ">"
298
298
  - !ruby/object:Gem::Version
299
- version: '0'
299
+ version: 1.3.1
300
300
  requirements:
301
301
  - none
302
302
  rubyforge_project:
303
- rubygems_version: 2.6.10
303
+ rubygems_version: 2.6.12
304
304
  signing_key:
305
305
  specification_version: 4
306
306
  summary: Web-flow and rendering framework putting the VC in MVC (part of Rails).