actionpack 4.2.2 → 4.2.3.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 +4 -4
- data/CHANGELOG.md +43 -1
- data/lib/action_controller/metal/strong_parameters.rb +4 -2
- data/lib/action_dispatch/http/response.rb +4 -5
- data/lib/action_dispatch/http/url.rb +1 -1
- data/lib/action_dispatch/journey/formatter.rb +1 -1
- data/lib/action_dispatch/journey/route.rb +1 -1
- data/lib/action_dispatch/journey/router.rb +0 -1
- data/lib/action_dispatch/journey/routes.rb +4 -0
- data/lib/action_dispatch/middleware/cookies.rb +3 -3
- data/lib/action_dispatch/middleware/static.rb +4 -1
- data/lib/action_dispatch/railtie.rb +2 -0
- data/lib/action_dispatch/routing/mapper.rb +1 -1
- data/lib/action_dispatch/routing/route_set.rb +4 -2
- data/lib/action_dispatch/testing/assertions.rb +1 -1
- data/lib/action_dispatch/testing/integration.rb +1 -1
- data/lib/action_dispatch/testing/test_response.rb +1 -12
- data/lib/action_pack/gem_version.rb +2 -2
- metadata +12 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f657e8aa0b1e7d37a531dd67f65500889f60999c
|
4
|
+
data.tar.gz: 6804ce0b2869e278603ff9cbb63c0dcf1c587219
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b47635795e0d214430dd501e36f2e11c5aafcc285ae1232e7096936de3dd76ee64ccabab4971e5cdbc6e2404ac16d79795a8ef174e98a16809cb405eee8c2531
|
7
|
+
data.tar.gz: b38ecd9fc4064c2eb1649d93c22063a5709bfeb204616731c1b189477c685cdcfae3f6686eacd3a49a58d999eb10d9a8bef40d7da762ad558dee5330d2649280
|
data/CHANGELOG.md
CHANGED
@@ -1,9 +1,51 @@
|
|
1
|
+
## Rails 4.2.3 (June 22, 2015) ##
|
2
|
+
|
3
|
+
* Fix rake routes not showing the right format when
|
4
|
+
nesting multiple routes.
|
5
|
+
|
6
|
+
See #18373.
|
7
|
+
|
8
|
+
*Ravil Bayramgalin*
|
9
|
+
|
10
|
+
* Fix regression where a gzip file response would have a Content-type,
|
11
|
+
even when it was a 304 status code.
|
12
|
+
|
13
|
+
See #19271.
|
14
|
+
|
15
|
+
*Kohei Suzuki*
|
16
|
+
|
17
|
+
* Fix handling of empty X_FORWARDED_HOST header in raw_host_with_port
|
18
|
+
|
19
|
+
Previously, an empty X_FORWARDED_HOST header would cause
|
20
|
+
Actiondispatch::Http:URL.raw_host_with_port to return nil, causing
|
21
|
+
Actiondispatch::Http:URL.host to raise a NoMethodError.
|
22
|
+
|
23
|
+
*Adam Forsyth*
|
24
|
+
|
25
|
+
* Fallback to `ENV['RAILS_RELATIVE_URL_ROOT']` in `url_for`.
|
26
|
+
|
27
|
+
Fixed an issue where the `RAILS_RELATIVE_URL_ROOT` environment variable is not
|
28
|
+
prepended to the path when `url_for` is called. If `SCRIPT_NAME` (used by Rack)
|
29
|
+
is set, it takes precedence.
|
30
|
+
|
31
|
+
Fixes #5122.
|
32
|
+
|
33
|
+
*Yasyf Mohamedali*
|
34
|
+
|
35
|
+
* Fix regression in functional tests. Responses should have default headers
|
36
|
+
assigned.
|
37
|
+
|
38
|
+
See #18423.
|
39
|
+
|
40
|
+
*Jeremy Kemper*, *Yves Senn*
|
41
|
+
|
42
|
+
|
1
43
|
## Rails 4.2.2 (June 16, 2015) ##
|
2
44
|
|
3
45
|
* No Changes *
|
4
46
|
|
5
47
|
|
6
|
-
## Rails 4.2.1 (March 19,
|
48
|
+
## Rails 4.2.1 (March 19, 2015) ##
|
7
49
|
|
8
50
|
* Non-string authenticity tokens do not raise NoMethodError when decoding
|
9
51
|
the masked token.
|
@@ -24,11 +24,13 @@ module ActionController
|
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
|
-
# Raised when a supplied parameter is not expected
|
27
|
+
# Raised when a supplied parameter is not expected and
|
28
|
+
# ActionController::Parameters.action_on_unpermitted_parameters
|
29
|
+
# is set to <tt>:raise</tt>.
|
28
30
|
#
|
29
31
|
# params = ActionController::Parameters.new(a: "123", b: "456")
|
30
32
|
# params.permit(:c)
|
31
|
-
# # => ActionController::UnpermittedParameters: found
|
33
|
+
# # => ActionController::UnpermittedParameters: found unpermitted parameters: a, b
|
32
34
|
class UnpermittedParameters < IndexError
|
33
35
|
attr_reader :params # :nodoc:
|
34
36
|
|
@@ -115,10 +115,11 @@ module ActionDispatch # :nodoc:
|
|
115
115
|
# The underlying body, as a streamable object.
|
116
116
|
attr_reader :stream
|
117
117
|
|
118
|
-
def initialize(status = 200, header = {}, body = [])
|
118
|
+
def initialize(status = 200, header = {}, body = [], options = {})
|
119
119
|
super()
|
120
120
|
|
121
|
-
|
121
|
+
default_headers = options.fetch(:default_headers, self.class.default_headers)
|
122
|
+
header = merge_default_headers(header, default_headers)
|
122
123
|
|
123
124
|
self.body, self.header, self.status = body, header, status
|
124
125
|
|
@@ -324,9 +325,7 @@ module ActionDispatch # :nodoc:
|
|
324
325
|
end
|
325
326
|
|
326
327
|
def merge_default_headers(original, default)
|
327
|
-
|
328
|
-
|
329
|
-
default.merge(original)
|
328
|
+
default.respond_to?(:merge) ? default.merge(original) : original
|
330
329
|
end
|
331
330
|
|
332
331
|
def build_buffer(response, body)
|
@@ -184,7 +184,7 @@ module ActionDispatch
|
|
184
184
|
|
185
185
|
# Returns the \host for this request, such as "example.com".
|
186
186
|
def raw_host_with_port
|
187
|
-
if forwarded = env["HTTP_X_FORWARDED_HOST"]
|
187
|
+
if forwarded = env["HTTP_X_FORWARDED_HOST"].presence
|
188
188
|
forwarded.split(/,\s?/).last
|
189
189
|
else
|
190
190
|
env['HTTP_HOST'] || "#{env['SERVER_NAME'] || env['SERVER_ADDR']}:#{env['SERVER_PORT']}"
|
@@ -40,7 +40,7 @@ module ActionDispatch
|
|
40
40
|
return [route.format(parameterized_parts), params]
|
41
41
|
end
|
42
42
|
|
43
|
-
message = "No route matches #{Hash[constraints.
|
43
|
+
message = "No route matches #{Hash[constraints.sort_by{|k,v| k.to_s}].inspect}"
|
44
44
|
message << " missing required keys: #{missing_keys.sort.inspect}" unless missing_keys.empty?
|
45
45
|
|
46
46
|
raise ActionController::UrlGenerationError, message
|
@@ -181,7 +181,7 @@ module ActionDispatch
|
|
181
181
|
# to the Message{Encryptor,Verifier} allows us to handle the
|
182
182
|
# (de)serialization step within the cookie jar, which gives us the
|
183
183
|
# opportunity to detect and migrate legacy cookies.
|
184
|
-
module VerifyAndUpgradeLegacySignedMessage
|
184
|
+
module VerifyAndUpgradeLegacySignedMessage # :nodoc:
|
185
185
|
def initialize(*args)
|
186
186
|
super
|
187
187
|
@legacy_verifier = ActiveSupport::MessageVerifier.new(@options[:secret_token], serializer: ActiveSupport::MessageEncryptor::NullSerializer)
|
@@ -392,7 +392,7 @@ module ActionDispatch
|
|
392
392
|
end
|
393
393
|
end
|
394
394
|
|
395
|
-
class JsonSerializer
|
395
|
+
class JsonSerializer # :nodoc:
|
396
396
|
def self.load(value)
|
397
397
|
ActiveSupport::JSON.decode(value)
|
398
398
|
end
|
@@ -402,7 +402,7 @@ module ActionDispatch
|
|
402
402
|
end
|
403
403
|
end
|
404
404
|
|
405
|
-
module SerializedCookieJars
|
405
|
+
module SerializedCookieJars # :nodoc:
|
406
406
|
MARSHAL_SIGNATURE = "\x04\x08".freeze
|
407
407
|
|
408
408
|
protected
|
@@ -29,7 +29,7 @@ module ActionDispatch
|
|
29
29
|
}
|
30
30
|
|
31
31
|
if match = paths.detect { |p|
|
32
|
-
path = File.join(@root, p)
|
32
|
+
path = File.join(@root, p.force_encoding('UTF-8'))
|
33
33
|
begin
|
34
34
|
File.file?(path) && File.readable?(path)
|
35
35
|
rescue SystemCallError
|
@@ -48,6 +48,9 @@ module ActionDispatch
|
|
48
48
|
if gzip_path && gzip_encoding_accepted?(env)
|
49
49
|
env['PATH_INFO'] = gzip_path
|
50
50
|
status, headers, body = @file_server.call(env)
|
51
|
+
if status == 304
|
52
|
+
return [status, headers, body]
|
53
|
+
end
|
51
54
|
headers['Content-Encoding'] = 'gzip'
|
52
55
|
headers['Content-Type'] = content_type(path)
|
53
56
|
else
|
@@ -40,6 +40,8 @@ module ActionDispatch
|
|
40
40
|
ActionDispatch::Cookies::CookieJar.always_write_cookie = config.action_dispatch.always_write_cookie
|
41
41
|
|
42
42
|
ActionDispatch.test_app = app
|
43
|
+
|
44
|
+
ActionDispatch::Routing::RouteSet.relative_url_root = app.config.relative_url_root
|
43
45
|
end
|
44
46
|
end
|
45
47
|
end
|
@@ -291,7 +291,7 @@ module ActionDispatch
|
|
291
291
|
when String
|
292
292
|
ActiveSupport::Deprecation.warn(<<-MSG.squish)
|
293
293
|
Defining a route where `to` is a controller without an action is deprecated.
|
294
|
-
Please change `to:
|
294
|
+
Please change `to: '#{to}'` to `controller: '#{to}'`.
|
295
295
|
MSG
|
296
296
|
|
297
297
|
[to, nil]
|
@@ -21,6 +21,8 @@ module ActionDispatch
|
|
21
21
|
# alias inspect to to_s.
|
22
22
|
alias inspect to_s
|
23
23
|
|
24
|
+
mattr_accessor :relative_url_root
|
25
|
+
|
24
26
|
class Dispatcher < Routing::Endpoint
|
25
27
|
def initialize(defaults)
|
26
28
|
@defaults = defaults
|
@@ -252,7 +254,7 @@ module ActionDispatch
|
|
252
254
|
end
|
253
255
|
|
254
256
|
def raise_generation_error(args, missing_keys)
|
255
|
-
constraints = Hash[@route.requirements.merge(args).
|
257
|
+
constraints = Hash[@route.requirements.merge(args).sort_by{|k,v| k.to_s}]
|
256
258
|
message = "No route matches #{constraints.inspect}"
|
257
259
|
message << " missing required keys: #{missing_keys.sort.inspect}"
|
258
260
|
|
@@ -768,7 +770,7 @@ module ActionDispatch
|
|
768
770
|
end
|
769
771
|
|
770
772
|
def find_script_name(options)
|
771
|
-
options.delete(:script_name) || ''
|
773
|
+
options.delete(:script_name) || relative_url_root || ''
|
772
774
|
end
|
773
775
|
|
774
776
|
def path_for(options, route_name = nil)
|
@@ -12,7 +12,7 @@ module ActionDispatch
|
|
12
12
|
include Rails::Dom::Testing::Assertions
|
13
13
|
|
14
14
|
def html_document
|
15
|
-
@html_document ||= if @response.content_type
|
15
|
+
@html_document ||= if @response.content_type === Mime::XML
|
16
16
|
Nokogiri::XML::Document.parse(@response.body)
|
17
17
|
else
|
18
18
|
Nokogiri::HTML::Document.parse(@response.body)
|
@@ -299,7 +299,7 @@ module ActionDispatch
|
|
299
299
|
@request_count += 1
|
300
300
|
@request = ActionDispatch::Request.new(session.last_request.env)
|
301
301
|
response = _mock_session.last_response
|
302
|
-
@response = ActionDispatch::TestResponse.
|
302
|
+
@response = ActionDispatch::TestResponse.from_response(response)
|
303
303
|
@html_document = nil
|
304
304
|
@url_options = nil
|
305
305
|
|
@@ -7,11 +7,7 @@ module ActionDispatch
|
|
7
7
|
# See Response for more information on controller response objects.
|
8
8
|
class TestResponse < Response
|
9
9
|
def self.from_response(response)
|
10
|
-
new.
|
11
|
-
resp.status = response.status
|
12
|
-
resp.headers = response.headers
|
13
|
-
resp.body = response.body
|
14
|
-
end
|
10
|
+
new response.status, response.headers, response.body, default_headers: nil
|
15
11
|
end
|
16
12
|
|
17
13
|
# Was the response successful?
|
@@ -25,12 +21,5 @@ module ActionDispatch
|
|
25
21
|
|
26
22
|
# Was there a server-side error?
|
27
23
|
alias_method :error?, :server_error?
|
28
|
-
|
29
|
-
def merge_default_headers(original, *args)
|
30
|
-
# Default headers are already applied, no need to merge them a second time.
|
31
|
-
# This makes sure that default headers, removed in controller actions, will
|
32
|
-
# not be reapplied to the test response.
|
33
|
-
original
|
34
|
-
end
|
35
24
|
end
|
36
25
|
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.
|
4
|
+
version: 4.2.3.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: 2015-06-
|
11
|
+
date: 2015-06-22 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.3.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.
|
26
|
+
version: 4.2.3.rc1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rack
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -61,7 +61,7 @@ dependencies:
|
|
61
61
|
version: '1.0'
|
62
62
|
- - ">="
|
63
63
|
- !ruby/object:Gem::Version
|
64
|
-
version: 1.0.
|
64
|
+
version: 1.0.2
|
65
65
|
type: :runtime
|
66
66
|
prerelease: false
|
67
67
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -71,7 +71,7 @@ dependencies:
|
|
71
71
|
version: '1.0'
|
72
72
|
- - ">="
|
73
73
|
- !ruby/object:Gem::Version
|
74
|
-
version: 1.0.
|
74
|
+
version: 1.0.2
|
75
75
|
- !ruby/object:Gem::Dependency
|
76
76
|
name: rails-dom-testing
|
77
77
|
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.3.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.
|
108
|
+
version: 4.2.3.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.
|
115
|
+
version: 4.2.3.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.
|
122
|
+
version: 4.2.3.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,9 +294,9 @@ 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:
|
299
|
+
version: 1.3.1
|
300
300
|
requirements:
|
301
301
|
- none
|
302
302
|
rubyforge_project:
|