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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e5ed67aa4c2a1c256d7497d71d3961f92feded4e
4
- data.tar.gz: 4117183896f22aa7ecf8348cb7e18f5bf40838b9
3
+ metadata.gz: aeddfb67cac617ad32696ee3adaa2b093431b815
4
+ data.tar.gz: 1b7a8a13a58c6ab3a40fbaef6b596ac6cb835d41
5
5
  SHA512:
6
- metadata.gz: 255dcb89c14dbb78bb4bc85e0be367f6b5ea90f6657480e84b837e69b6a8a2ed41390ab82822cbeaa5fcb1fc7f72298d635bb01c4e96939fc5ddcf00d0abcd6d
7
- data.tar.gz: 032a2a3534e2937b963c576ccbd6f13920b06bc066492fea551ad2f572107924f18b349112c5876c0b0ede5018e010975c5a644f0cd5cf8e389fde0bc1e3b3b2
6
+ metadata.gz: cbcc316942ff356642c0a9f623acef78a1e5faf79f7c9eb03213fb2800d2b157a69423bbb5d1bef2348d26549f39d8eace0c501884d4e15f07e78e5fdbbcd348
7
+ data.tar.gz: a50674d3c7fdfcbd4902573392e3e7dccb17df02ddc19fb853a89ec8457bb82f72ef476e74e37044fe943a5d0248d5eac95aab081611c82bbec122bd4ffa338d
@@ -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.to_sentence(:locale => :en)}")
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}" if name
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
- path_info = match.post_match
67
- env['PATH_INFO'] = path_info
68
- env['PATH_INFO'] = "/" + path_info unless path_info.start_with? "/"
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' => :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
- 'ActionDispatch::ParamsParser::ParseError' => :bad_request,
17
- 'ActionController::BadRequest' => :bad_request,
18
- 'ActionController::ParameterMissing' => :bad_request
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 = {}, message=nil)
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
@@ -7,8 +7,8 @@ module ActionPack
7
7
  module VERSION
8
8
  MAJOR = 4
9
9
  MINOR = 1
10
- TINY = 7
11
- PRE = "1"
10
+ TINY = 8
11
+ PRE = nil
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.1.7.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-19 00:00:00.000000000 Z
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.7.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.7.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.7.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.7.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.7.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.7.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.2.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).