actionpack 4.1.7.1 → 4.1.8
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 +4 -4
- data/CHANGELOG.md +13 -0
- data/lib/action_dispatch/http/request.rb +1 -1
- data/lib/action_dispatch/journey/formatter.rb +1 -1
- data/lib/action_dispatch/journey/router.rb +3 -3
- data/lib/action_dispatch/middleware/exception_wrapper.rb +11 -10
- data/lib/action_dispatch/middleware/public_exceptions.rb +5 -1
- data/lib/action_dispatch/testing/assertions/routing.rb +8 -8
- data/lib/action_pack/gem_version.rb +2 -2
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aeddfb67cac617ad32696ee3adaa2b093431b815
|
4
|
+
data.tar.gz: 1b7a8a13a58c6ab3a40fbaef6b596ac6cb835d41
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cbcc316942ff356642c0a9f623acef78a1e5faf79f7c9eb03213fb2800d2b157a69423bbb5d1bef2348d26549f39d8eace0c501884d4e15f07e78e5fdbbcd348
|
7
|
+
data.tar.gz: a50674d3c7fdfcbd4902573392e3e7dccb17df02ddc19fb853a89ec8457bb82f72ef476e74e37044fe943a5d0248d5eac95aab081611c82bbec122bd4ffa338d
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,16 @@
|
|
1
|
+
* Fix regression where path was getting overwritten when route anchor was false, and X-Cascade pass
|
2
|
+
|
3
|
+
fixes #17035.
|
4
|
+
|
5
|
+
*arthurnn*
|
6
|
+
|
7
|
+
* Fix a bug where malformed query strings lead to 500.
|
8
|
+
|
9
|
+
fixes #11502.
|
10
|
+
|
11
|
+
*Yuki Nishijima*
|
12
|
+
|
13
|
+
|
1
14
|
## Rails 4.1.6 (September 11, 2014) ##
|
2
15
|
|
3
16
|
* Prepend a JS comment to JSONP callbacks. Addresses CVE-2014-4671
|
@@ -315,7 +315,7 @@ module ActionDispatch
|
|
315
315
|
|
316
316
|
private
|
317
317
|
def check_method(name)
|
318
|
-
HTTP_METHOD_LOOKUP[name] || raise(ActionController::UnknownHttpMethod, "#{name}, accepted HTTP methods are #{HTTP_METHODS.
|
318
|
+
HTTP_METHOD_LOOKUP[name] || raise(ActionController::UnknownHttpMethod, "#{name}, accepted HTTP methods are #{HTTP_METHODS[0...-1].join(', ')}, and #{HTTP_METHODS[-1]}")
|
319
319
|
name
|
320
320
|
end
|
321
321
|
end
|
@@ -34,7 +34,7 @@ module ActionDispatch
|
|
34
34
|
end
|
35
35
|
|
36
36
|
message = "No route matches #{Hash[constraints.sort].inspect}"
|
37
|
-
message << " missing required keys: #{missing_keys.sort.inspect}"
|
37
|
+
message << " missing required keys: #{missing_keys.sort.inspect}" unless missing_keys.empty?
|
38
38
|
|
39
39
|
raise ActionController::UrlGenerationError, message
|
40
40
|
end
|
@@ -63,9 +63,9 @@ module ActionDispatch
|
|
63
63
|
|
64
64
|
unless route.path.anchored
|
65
65
|
env['SCRIPT_NAME'] = (script_name.to_s + match.to_s).chomp('/')
|
66
|
-
|
67
|
-
env['PATH_INFO'] =
|
68
|
-
env['PATH_INFO'] = "/" +
|
66
|
+
matched_path = match.post_match
|
67
|
+
env['PATH_INFO'] = matched_path
|
68
|
+
env['PATH_INFO'] = "/" + matched_path unless matched_path.start_with? "/"
|
69
69
|
end
|
70
70
|
|
71
71
|
env[@params_key] = (set_params || {}).merge parameters
|
@@ -6,16 +6,17 @@ module ActionDispatch
|
|
6
6
|
cattr_accessor :rescue_responses
|
7
7
|
@@rescue_responses = Hash.new(:internal_server_error)
|
8
8
|
@@rescue_responses.merge!(
|
9
|
-
'ActionController::RoutingError'
|
10
|
-
'AbstractController::ActionNotFound'
|
11
|
-
'ActionController::MethodNotAllowed'
|
12
|
-
'ActionController::UnknownHttpMethod'
|
13
|
-
'ActionController::NotImplemented'
|
14
|
-
'ActionController::UnknownFormat'
|
15
|
-
'ActionController::InvalidAuthenticityToken'
|
16
|
-
'
|
17
|
-
'
|
18
|
-
'ActionController::
|
9
|
+
'ActionController::RoutingError' => :not_found,
|
10
|
+
'AbstractController::ActionNotFound' => :not_found,
|
11
|
+
'ActionController::MethodNotAllowed' => :method_not_allowed,
|
12
|
+
'ActionController::UnknownHttpMethod' => :method_not_allowed,
|
13
|
+
'ActionController::NotImplemented' => :not_implemented,
|
14
|
+
'ActionController::UnknownFormat' => :not_acceptable,
|
15
|
+
'ActionController::InvalidAuthenticityToken' => :unprocessable_entity,
|
16
|
+
'ActionController::InvalidCrossOriginRequest' => :unprocessable_entity,
|
17
|
+
'ActionDispatch::ParamsParser::ParseError' => :bad_request,
|
18
|
+
'ActionController::BadRequest' => :bad_request,
|
19
|
+
'ActionController::ParameterMissing' => :bad_request
|
19
20
|
)
|
20
21
|
|
21
22
|
cattr_accessor :rescue_templates
|
@@ -9,8 +9,12 @@ module ActionDispatch
|
|
9
9
|
def call(env)
|
10
10
|
status = env["PATH_INFO"][1..-1]
|
11
11
|
request = ActionDispatch::Request.new(env)
|
12
|
-
content_type = request.formats.first
|
13
12
|
body = { :status => status, :error => Rack::Utils::HTTP_STATUS_CODES.fetch(status.to_i, Rack::Utils::HTTP_STATUS_CODES[500]) }
|
13
|
+
content_type = begin
|
14
|
+
request.formats.first
|
15
|
+
rescue ActionController::BadRequest
|
16
|
+
Mime::HTML
|
17
|
+
end
|
14
18
|
|
15
19
|
render(status, content_type, body)
|
16
20
|
end
|
@@ -38,7 +38,7 @@ module ActionDispatch
|
|
38
38
|
# # Test a custom route
|
39
39
|
# assert_recognizes({controller: 'items', action: 'show', id: '1'}, 'view/item1')
|
40
40
|
def assert_recognizes(expected_options, path, extras={}, msg=nil)
|
41
|
-
request = recognized_request_for(path, extras)
|
41
|
+
request = recognized_request_for(path, extras, msg)
|
42
42
|
|
43
43
|
expected_options = expected_options.clone
|
44
44
|
|
@@ -69,9 +69,9 @@ module ActionDispatch
|
|
69
69
|
#
|
70
70
|
# # Asserts that the generated route gives us our custom route
|
71
71
|
# assert_generates "changesets/12", { controller: 'scm', action: 'show_diff', revision: "12" }
|
72
|
-
def assert_generates(expected_path, options, defaults={}, extras
|
72
|
+
def assert_generates(expected_path, options, defaults={}, extras={}, message=nil)
|
73
73
|
if expected_path =~ %r{://}
|
74
|
-
fail_on(URI::InvalidURIError) do
|
74
|
+
fail_on(URI::InvalidURIError, message) do
|
75
75
|
uri = URI.parse(expected_path)
|
76
76
|
expected_path = uri.path.to_s.empty? ? "/" : uri.path
|
77
77
|
end
|
@@ -174,7 +174,7 @@ module ActionDispatch
|
|
174
174
|
|
175
175
|
private
|
176
176
|
# Recognizes the route for a given path.
|
177
|
-
def recognized_request_for(path, extras = {})
|
177
|
+
def recognized_request_for(path, extras = {}, msg)
|
178
178
|
if path.is_a?(Hash)
|
179
179
|
method = path[:method]
|
180
180
|
path = path[:path]
|
@@ -186,7 +186,7 @@ module ActionDispatch
|
|
186
186
|
request = ActionController::TestRequest.new
|
187
187
|
|
188
188
|
if path =~ %r{://}
|
189
|
-
fail_on(URI::InvalidURIError) do
|
189
|
+
fail_on(URI::InvalidURIError, msg) do
|
190
190
|
uri = URI.parse(path)
|
191
191
|
request.env["rack.url_scheme"] = uri.scheme || "http"
|
192
192
|
request.host = uri.host if uri.host
|
@@ -200,7 +200,7 @@ module ActionDispatch
|
|
200
200
|
|
201
201
|
request.request_method = method if method
|
202
202
|
|
203
|
-
params = fail_on(ActionController::RoutingError) do
|
203
|
+
params = fail_on(ActionController::RoutingError, msg) do
|
204
204
|
@routes.recognize_path(path, { :method => method, :extras => extras })
|
205
205
|
end
|
206
206
|
request.path_parameters = params.with_indifferent_access
|
@@ -208,10 +208,10 @@ module ActionDispatch
|
|
208
208
|
request
|
209
209
|
end
|
210
210
|
|
211
|
-
def fail_on(exception_class)
|
211
|
+
def fail_on(exception_class, message)
|
212
212
|
yield
|
213
213
|
rescue exception_class => e
|
214
|
-
raise Minitest::Assertion, e.message
|
214
|
+
raise Minitest::Assertion, message || e.message
|
215
215
|
end
|
216
216
|
end
|
217
217
|
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.1.
|
4
|
+
version: 4.1.8
|
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: 2014-11-
|
11
|
+
date: 2014-11-16 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.1.
|
19
|
+
version: 4.1.8
|
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.1.
|
26
|
+
version: 4.1.8
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rack
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -58,28 +58,28 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - '='
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 4.1.
|
61
|
+
version: 4.1.8
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - '='
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 4.1.
|
68
|
+
version: 4.1.8
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: activemodel
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - '='
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: 4.1.
|
75
|
+
version: 4.1.8
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - '='
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: 4.1.
|
82
|
+
version: 4.1.8
|
83
83
|
description: Web apps on Rails. Simple, battle-tested conventions for building and
|
84
84
|
testing MVC web applications. Works with any Rack-compatible server.
|
85
85
|
email: david@loudthinking.com
|
@@ -258,7 +258,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
258
258
|
requirements:
|
259
259
|
- none
|
260
260
|
rubyforge_project:
|
261
|
-
rubygems_version: 2.
|
261
|
+
rubygems_version: 2.4.2
|
262
262
|
signing_key:
|
263
263
|
specification_version: 4
|
264
264
|
summary: Web-flow and rendering framework putting the VC in MVC (part of Rails).
|