Hello community,
here is the log from the commit of package rubygem-actionpack-5_0 for
openSUSE:Factory checked in at 2017-06-08 14:59:23
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-actionpack-5_0 (Old)
and /work/SRC/openSUSE:Factory/.rubygem-actionpack-5_0.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-actionpack-5_0"
Thu Jun 8 14:59:23 2017 rev:5 rq:497663 version:5.0.3
Changes:
--------
---
/work/SRC/openSUSE:Factory/rubygem-actionpack-5_0/rubygem-actionpack-5_0.changes
2017-03-21 22:49:51.136211205 +0100
+++
/work/SRC/openSUSE:Factory/.rubygem-actionpack-5_0.new/rubygem-actionpack-5_0.changes
2017-06-08 14:59:23.817559779 +0200
@@ -1,0 +2,96 @@
+Tue May 23 09:35:00 UTC 2017 - [email protected]
+
+- updated to version 5.0.3
+ see installed CHANGELOG.md
+
+ * Raise exception when calling `to_h` in an unfiltered Parameters.
+
+ This method will raise on unfiltered Parameters if
+ `config.action_controller.raise_on_unfiltered_parameters` is true.
+
+ Before we returned either an empty hash or only the always permitted
parameters
+ (`:controller` and `:action` by default).
+
+ The previous behavior was dangerous because in order to get the
attributes users
+ usually fallback to use `to_unsafe_h` that could potentially introduce
security issues.
+
+ *Rafael Mendonça França*
+
+ * Add `ActionController::Parameters#to_hash` to implicit conversion.
+
+ Now methods that implicit convert objects to a hash will be able to work
without
+ requiring the users to change their implementation.
+
+ This method will return a `Hash` instead of a
`ActiveSupport::HashWithIndefirentAccess`
+ to mimic the same implementation of
`ActiveSupport::HashWithIndefirentAccess#to_hash`.
+
+ This method will raise on unfiltered Parameters if
+ `config.action_controller.raise_on_unfiltered_parameters` is true.
+
+ *Rafael Mendonça França*
+
+ * Undeprecate `ActionController::Parameters#to_query` and `#to_param`.
+
+ Previously it was raising a deprecation because it may be unsafe to use
those methods
+ in an unfiltered parameter. Now we delegate to `#to_h` that already
raise an error when
+ the Parameters instance is not permitted.
+
+ This also fix a bug when using `#to_query` in a hash that contains a
+ `ActionController::Parameters` instance and was returning the name of
the class in the
+ string.
+
+ *Rafael Mendonça França*
+
+ * Use more specific check for :format in route path
+
+ The current check for whether to add an optional format to the path is
very lax
+ and will match things like `:format_id` where there are nested
resources, e.g:
+
+ ``` ruby
+ resources :formats do
+ resources :items
+ end
+ ```
+
+ Fix this by using a more restrictive regex pattern that looks for the
patterns
+ `(.:format)`, `.:format` or `/` at the end of the path. Note that we
need to
+ allow for multiple closing parenthesis since the route may be of this
form:
+
+ ``` ruby
+ get "/books(/:action(.:format))", controller: "books"
+ ```
+
+ This probably isn't what's intended since it means that the default
index action
+ route doesn't support a format but we have a test for it so we need to
allow it.
+
+ Fixes #28517.
+
+ *Andrew White*
+
+ * Don't include default headers in `ActionController::Metal` responses
+
+ The commit e16afe6 introduced an unintentional change of behavior where
the default
+ headers were included in responses from `ActionController::Metai` based
controllers.
+ This is now reverted to the previous behavior of having no default
headers.
+
+ Fixes #25820.
+
+ *Jon Moss*
+
+ * Fix malformed URLS when using `ApplicationController.renderer`
+
+ The Rack environment variable `rack.url_scheme` was not being set so
`scheme` was
+ returning `nil`. This caused URLs to be malformed with the default
settings.
+ Fix this by setting `rack.url_scheme` when the environment is normalized.
+
+ Fixes #28151.
+
+ *George Vrettos*
+
+ * Commit flash changes when using a redirect route.
+
+ Fixes #27992.
+
+ *Andrew White*
+
+-------------------------------------------------------------------
Old:
----
actionpack-5.0.2.gem
New:
----
actionpack-5.0.3.gem
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ rubygem-actionpack-5_0.spec ++++++
--- /var/tmp/diff_new_pack.1Q0JqT/_old 2017-06-08 14:59:25.029388752 +0200
+++ /var/tmp/diff_new_pack.1Q0JqT/_new 2017-06-08 14:59:25.029388752 +0200
@@ -24,7 +24,7 @@
#
Name: rubygem-actionpack-5_0
-Version: 5.0.2
+Version: 5.0.3
Release: 0
%define mod_name actionpack
%define mod_full_name %{mod_name}-%{version}
++++++ actionpack-5.0.2.gem -> actionpack-5.0.3.gem ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/CHANGELOG.md new/CHANGELOG.md
--- old/CHANGELOG.md 2017-03-02 00:12:03.000000000 +0100
+++ new/CHANGELOG.md 2017-05-12 22:03:55.000000000 +0200
@@ -1,3 +1,94 @@
+* Raise exception when calling `to_h` in an unfiltered Parameters.
+
+ This method will raise on unfiltered Parameters if
+ `config.action_controller.raise_on_unfiltered_parameters` is true.
+
+ Before we returned either an empty hash or only the always permitted
parameters
+ (`:controller` and `:action` by default).
+
+ The previous behavior was dangerous because in order to get the attributes
users
+ usually fallback to use `to_unsafe_h` that could potentially introduce
security issues.
+
+ *Rafael Mendonça França*
+
+* Add `ActionController::Parameters#to_hash` to implicit conversion.
+
+ Now methods that implicit convert objects to a hash will be able to work
without
+ requiring the users to change their implementation.
+
+ This method will return a `Hash` instead of a
`ActiveSupport::HashWithIndefirentAccess`
+ to mimic the same implementation of
`ActiveSupport::HashWithIndefirentAccess#to_hash`.
+
+ This method will raise on unfiltered Parameters if
+ `config.action_controller.raise_on_unfiltered_parameters` is true.
+
+ *Rafael Mendonça França*
+
+* Undeprecate `ActionController::Parameters#to_query` and `#to_param`.
+
+ Previously it was raising a deprecation because it may be unsafe to use
those methods
+ in an unfiltered parameter. Now we delegate to `#to_h` that already raise
an error when
+ the Parameters instance is not permitted.
+
+ This also fix a bug when using `#to_query` in a hash that contains a
+ `ActionController::Parameters` instance and was returning the name of the
class in the
+ string.
+
+ *Rafael Mendonça França*
+
+* Use more specific check for :format in route path
+
+ The current check for whether to add an optional format to the path is
very lax
+ and will match things like `:format_id` where there are nested resources,
e.g:
+
+ ``` ruby
+ resources :formats do
+ resources :items
+ end
+ ```
+
+ Fix this by using a more restrictive regex pattern that looks for the
patterns
+ `(.:format)`, `.:format` or `/` at the end of the path. Note that we need
to
+ allow for multiple closing parenthesis since the route may be of this form:
+
+ ``` ruby
+ get "/books(/:action(.:format))", controller: "books"
+ ```
+
+ This probably isn't what's intended since it means that the default index
action
+ route doesn't support a format but we have a test for it so we need to
allow it.
+
+ Fixes #28517.
+
+ *Andrew White*
+
+* Don't include default headers in `ActionController::Metal` responses
+
+ The commit e16afe6 introduced an unintentional change of behavior where
the default
+ headers were included in responses from `ActionController::Metai` based
controllers.
+ This is now reverted to the previous behavior of having no default headers.
+
+ Fixes #25820.
+
+ *Jon Moss*
+
+* Fix malformed URLS when using `ApplicationController.renderer`
+
+ The Rack environment variable `rack.url_scheme` was not being set so
`scheme` was
+ returning `nil`. This caused URLs to be malformed with the default
settings.
+ Fix this by setting `rack.url_scheme` when the environment is normalized.
+
+ Fixes #28151.
+
+ *George Vrettos*
+
+* Commit flash changes when using a redirect route.
+
+ Fixes #27992.
+
+ *Andrew White*
+
+
## Rails 5.0.2 (March 01, 2017) ##
* Make `with_routing` test helper work when testing controllers inheriting
from `ActionController::API`.
Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/action_controller/base.rb
new/lib/action_controller/base.rb
--- old/lib/action_controller/base.rb 2017-03-02 00:12:03.000000000 +0100
+++ new/lib/action_controller/base.rb 2017-05-12 22:03:55.000000000 +0200
@@ -260,6 +260,12 @@
PROTECTED_IVARS
end
+ def self.make_response!(request)
+ ActionDispatch::Response.create.tap do |res|
+ res.request = request
+ end
+ end
+
ActiveSupport.run_load_hooks(:action_controller, self)
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/action_controller/metal/strong_parameters.rb
new/lib/action_controller/metal/strong_parameters.rb
--- old/lib/action_controller/metal/strong_parameters.rb 2017-03-02
00:12:03.000000000 +0100
+++ new/lib/action_controller/metal/strong_parameters.rb 2017-05-12
22:03:55.000000000 +0200
@@ -43,6 +43,18 @@
end
end
+ # Raised when a Parameters instance is not marked as permitted and
+ # an operation to transform it to hash is called.
+ #
+ # params = ActionController::Parameters.new(a: "123", b: "456")
+ # params.to_h
+ # # => ActionController::UnfilteredParameters: unable to convert
unpermitted parameters to hash
+ class UnfilteredParameters < ArgumentError
+ def initialize # :nodoc:
+ super("unable to convert unpermitted parameters to hash")
+ end
+ end
+
# == Action Controller \Parameters
#
# Allows you to choose which attributes should be whitelisted for mass
updating
@@ -53,9 +65,9 @@
#
# params = ActionController::Parameters.new({
# person: {
- # name: 'Francesco',
+ # name: "Francesco",
# age: 22,
- # role: 'admin'
+ # role: "admin"
# }
# })
#
@@ -103,13 +115,85 @@
# You can fetch values of <tt>ActionController::Parameters</tt> using either
# <tt>:key</tt> or <tt>"key"</tt>.
#
- # params = ActionController::Parameters.new(key: 'value')
+ # params = ActionController::Parameters.new(key: "value")
# params[:key] # => "value"
# params["key"] # => "value"
class Parameters
cattr_accessor :permit_all_parameters, instance_accessor: false
cattr_accessor :action_on_unpermitted_parameters, instance_accessor: false
+ cattr_accessor :raise_on_unfiltered_parameters, instance_accessor: false
+
+ ##
+ # :method: as_json
+ #
+ # :call-seq:
+ # as_json(options=nil)
+ #
+ # Returns a hash that can be used as the JSON representation for the
params.
+
+ ##
+ # :method: empty?
+ #
+ # :call-seq:
+ # empty?()
+ #
+ # Returns true if the object has no key/value pairs.
+
+ ##
+ # :method: has_key?
+ #
+ # :call-seq:
+ # has_key?(key)
+ #
+ # Returns true if the given key is present in the parameters.
+
+ ##
+ # :method: has_value?
+ #
+ # :call-seq:
+ # has_value?(value)
+ #
+ # Returns true if the given value is present for some key in the
parameters.
+
+ ##
+ # :method: include?
+ #
+ # :call-seq:
+ # include?(key)
+ #
+ # Returns true if the given key is present in the parameters.
+
+ ##
+ # :method: key?
+ #
+ # :call-seq:
+ # key?(key)
+ #
+ # Returns true if the given key is present in the parameters.
+ ##
+ # :method: keys
+ #
+ # :call-seq:
+ # keys()
+ #
+ # Returns a new array of the keys of the parameters.
+
+ ##
+ # :method: value?
+ #
+ # :call-seq:
+ # value?(value)
+ #
+ # Returns true if the given value is present for some key in the
parameters.
+
+ ##
+ # :method: values
+ #
+ # :call-seq:
+ # values()
+ #
+ # Returns a new array of the values of the parameters.
delegate :keys, :key?, :has_key?, :values, :has_value?, :value?, :empty?,
:include?,
:as_json, to: :@parameters
@@ -130,13 +214,13 @@
# class Person < ActiveRecord::Base
# end
#
- # params = ActionController::Parameters.new(name: 'Francesco')
+ # params = ActionController::Parameters.new(name: "Francesco")
# params.permitted? # => false
# Person.new(params) # => ActiveModel::ForbiddenAttributesError
#
# ActionController::Parameters.permit_all_parameters = true
#
- # params = ActionController::Parameters.new(name: 'Francesco')
+ # params = ActionController::Parameters.new(name: "Francesco")
# params.permitted? # => true
# Person.new(params) # => #<Person id: nil, name: "Francesco">
def initialize(parameters = {})
@@ -164,31 +248,93 @@
end
# Returns a safe <tt>ActiveSupport::HashWithIndifferentAccess</tt>
- # representation of this parameter with all unpermitted keys removed.
+ # representation of the parameters with all unpermitted keys removed.
#
# params = ActionController::Parameters.new({
- # name: 'Senjougahara Hitagi',
- # oddity: 'Heavy stone crab'
+ # name: "Senjougahara Hitagi",
+ # oddity: "Heavy stone crab"
# })
- # params.to_h # => {}
+ # params.to_h
+ # # => ActionController::UnfilteredParameters: unable to convert
unfiltered parameters to hash
#
# safe_params = params.permit(:name)
# safe_params.to_h # => {"name"=>"Senjougahara Hitagi"}
def to_h
if permitted?
convert_parameters_to_hashes(@parameters, :to_h)
+ elsif self.class.raise_on_unfiltered_parameters
+ raise UnfilteredParameters
else
slice(*self.class.always_permitted_parameters).permit!.to_h
end
end
+ # Returns a safe <tt>Hash</tt> representation of the parameters
+ # with all unpermitted keys removed.
+ #
+ # params = ActionController::Parameters.new({
+ # name: "Senjougahara Hitagi",
+ # oddity: "Heavy stone crab"
+ # })
+ # params.to_hash
+ # # => ActionController::UnfilteredParameters: unable to convert
unfiltered parameters to hash
+ #
+ # safe_params = params.permit(:name)
+ # safe_params.to_hash # => {"name"=>"Senjougahara Hitagi"}
+ def to_hash
+ if self.class.raise_on_unfiltered_parameters
+ to_h.to_hash
+ else
+ message = <<-DEPRECATE.squish
+ #to_hash unexpectedly ignores parameter filtering, and will change
to enforce it in Rails 5.1.
+ Enable `raise_on_unfiltered_parameters` to respect parameter
filtering, which is the default
+ in new applications. For the existing deprecated behaviour, call
#to_unsafe_h instead.
+ DEPRECATE
+ ActiveSupport::Deprecation.warn(message)
+
+ @parameters.to_hash
+ end
+ end
+
+ # Returns a string representation of the receiver suitable for use as a URL
+ # query string:
+ #
+ # params = ActionController::Parameters.new({
+ # name: "David",
+ # nationality: "Danish"
+ # })
+ # params.to_query
+ # # => "name=David&nationality=Danish"
+ #
+ # An optional namespace can be passed to enclose key names:
+ #
+ # params = ActionController::Parameters.new({
+ # name: "David",
+ # nationality: "Danish"
+ # })
+ # params.to_query("user")
+ # # => "user%5Bname%5D=David&user%5Bnationality%5D=Danish"
+ #
+ # The string pairs "key=value" that conform the query string
+ # are sorted lexicographically in ascending order.
+ #
+ # This method is also aliased as +to_param+.
+ def to_query(*args)
+ if self.class.raise_on_unfiltered_parameters
+ to_h.to_query(*args)
+ else
+ @parameters.to_query(*args)
+ end
+ end
+ alias_method :to_param, :to_query
+
# Returns an unsafe, unfiltered
- # <tt>ActiveSupport::HashWithIndifferentAccess</tt> representation of this
- # parameter.
+ # <tt>ActiveSupport::HashWithIndifferentAccess</tt> representation of the
+ # parameters.
#
# params = ActionController::Parameters.new({
- # name: 'Senjougahara Hitagi',
- # oddity: 'Heavy stone crab'
+ # name: "Senjougahara Hitagi",
+ # oddity: "Heavy stone crab"
# })
# params.to_unsafe_h
# # => {"name"=>"Senjougahara Hitagi", "oddity" => "Heavy stone crab"}
@@ -233,7 +379,7 @@
# class Person < ActiveRecord::Base
# end
#
- # params = ActionController::Parameters.new(name: 'Francesco')
+ # params = ActionController::Parameters.new(name: "Francesco")
# params.permitted? # => false
# Person.new(params) # => ActiveModel::ForbiddenAttributesError
# params.permit!
@@ -255,7 +401,7 @@
# When passed a single key, if it exists and its associated value is
# either present or the singleton +false+, returns said value:
#
- # ActionController::Parameters.new(person: { name: 'Francesco'
}).require(:person)
+ # ActionController::Parameters.new(person: { name: "Francesco"
}).require(:person)
# # => <ActionController::Parameters {"name"=>"Francesco"} permitted:
false>
#
# Otherwise raises <tt>ActionController::ParameterMissing</tt>:
@@ -288,7 +434,7 @@
# Technically this method can be used to fetch terminal values:
#
# # CAREFUL
- # params = ActionController::Parameters.new(person: { name: 'Finn' })
+ # params = ActionController::Parameters.new(person: { name: "Finn" })
# name = params.require(:person).require(:name) # CAREFUL
#
# but take into account that at some point those ones have to be permitted:
@@ -318,7 +464,7 @@
# for the object to +true+. This is useful for limiting which attributes
# should be allowed for mass updating.
#
- # params = ActionController::Parameters.new(user: { name: 'Francesco',
age: 22, role: 'admin' })
+ # params = ActionController::Parameters.new(user: { name: "Francesco",
age: 22, role: "admin" })
# permitted = params.require(:user).permit(:name, :age)
# permitted.permitted? # => true
# permitted.has_key?(:name) # => true
@@ -338,18 +484,18 @@
# You may declare that the parameter should be an array of permitted
scalars
# by mapping it to an empty array:
#
- # params = ActionController::Parameters.new(tags: ['rails',
'parameters'])
+ # params = ActionController::Parameters.new(tags: ["rails",
"parameters"])
# params.permit(tags: [])
#
# You can also use +permit+ on nested parameters, like:
#
# params = ActionController::Parameters.new({
# person: {
- # name: 'Francesco',
+ # name: "Francesco",
# age: 22,
# pets: [{
- # name: 'Purplish',
- # category: 'dogs'
+ # name: "Purplish",
+ # category: "dogs"
# }]
# }
# })
@@ -368,8 +514,8 @@
# params = ActionController::Parameters.new({
# person: {
# contact: {
- # email: '[email protected]',
- # phone: '555-1234'
+ # email: "[email protected]",
+ # phone: "555-1234"
# }
# }
# })
@@ -402,7 +548,7 @@
# Returns a parameter for the given +key+. If not found,
# returns +nil+.
#
- # params = ActionController::Parameters.new(person: { name: 'Francesco'
})
+ # params = ActionController::Parameters.new(person: { name: "Francesco"
})
# params[:person] # => <ActionController::Parameters
{"name"=>"Francesco"} permitted: false>
# params[:none] # => nil
def [](key)
@@ -421,11 +567,11 @@
# if more arguments are given, then that will be returned; if a block
# is given, then that will be run and its result returned.
#
- # params = ActionController::Parameters.new(person: { name: 'Francesco'
})
+ # params = ActionController::Parameters.new(person: { name: "Francesco"
})
# params.fetch(:person) # => <ActionController::Parameters
{"name"=>"Francesco"} permitted: false>
# params.fetch(:none) # =>
ActionController::ParameterMissing: param is missing or the value is empty: none
- # params.fetch(:none, 'Francesco') # => "Francesco"
- # params.fetch(:none) { 'Francesco' } # => "Francesco"
+ # params.fetch(:none, "Francesco") # => "Francesco"
+ # params.fetch(:none) { "Francesco" } # => "Francesco"
def fetch(key, *args)
convert_value_to_parameters(
@parameters.fetch(key) {
@@ -536,8 +682,8 @@
# to key. If the key is not found, returns the default value. If the
# optional code block is given and the key is not found, pass in the key
# and return the result of block.
- def delete(key)
- convert_value_to_parameters(@parameters.delete(key))
+ def delete(key, &block)
+ convert_value_to_parameters(@parameters.delete(key, &block))
end
# Returns a new instance of <tt>ActionController::Parameters</tt> with only
@@ -625,10 +771,6 @@
end
end
- # Undefine `to_param` such that it gets caught in the `method_missing`
- # deprecation cycle below.
- undef_method :to_param
-
def method_missing(method_sym, *args, &block)
if @parameters.respond_to?(method_sym)
message = <<-DEPRECATE.squish
@@ -647,7 +789,11 @@
end
end
- # Returns duplicate of object including all parameters
+ def respond_to?(name, include_all = false) # :nodoc:
+ super || @parameters.respond_to?(name, include_all)
+ end
+
+ # Returns duplicate of object including all parameters.
def deep_dup
self.class.new(@parameters.deep_dup).tap do |duplicate|
duplicate.permitted = @permitted
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/action_controller/metal.rb
new/lib/action_controller/metal.rb
--- old/lib/action_controller/metal.rb 2017-03-02 00:12:03.000000000 +0100
+++ new/lib/action_controller/metal.rb 2017-05-12 22:03:55.000000000 +0200
@@ -134,7 +134,7 @@
end
def self.make_response!(request)
- ActionDispatch::Response.create.tap do |res|
+ ActionDispatch::Response.new.tap do |res|
res.request = request
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/action_controller/railtie.rb
new/lib/action_controller/railtie.rb
--- old/lib/action_controller/railtie.rb 2017-03-02 00:12:03.000000000
+0100
+++ new/lib/action_controller/railtie.rb 2017-05-12 22:03:55.000000000
+0200
@@ -27,6 +27,7 @@
ActionController::Parameters.always_permitted_parameters =
app.config.action_controller.delete(:always_permitted_parameters)
end
+ ActionController::Parameters.raise_on_unfiltered_parameters =
options.delete(:raise_on_unfiltered_parameters) { false }
ActionController::Parameters.action_on_unpermitted_parameters =
options.delete(:action_on_unpermitted_parameters) do
(Rails.env.test? || Rails.env.development?) ? :log : false
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/action_controller/renderer.rb
new/lib/action_controller/renderer.rb
--- old/lib/action_controller/renderer.rb 2017-03-02 00:12:03.000000000
+0100
+++ new/lib/action_controller/renderer.rb 2017-05-12 22:03:55.000000000
+0200
@@ -85,6 +85,7 @@
def normalize_keys(env)
new_env = {}
env.each_pair { |k,v| new_env[rack_key_for(k)] = rack_value_for(k, v) }
+ new_env["rack.url_scheme"] = new_env["HTTPS"] == "on" ? "https" :
"http"
new_env
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/action_controller/test_case.rb
new/lib/action_controller/test_case.rb
--- old/lib/action_controller/test_case.rb 2017-03-02 00:12:03.000000000
+0100
+++ new/lib/action_controller/test_case.rb 2017-05-12 22:03:55.000000000
+0200
@@ -568,7 +568,6 @@
@request.delete_header 'HTTP_ACCEPT'
end
@request.query_string = ''
- @request.env.delete "PATH_INFO"
@response.sent!
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/action_dispatch/routing/mapper.rb
new/lib/action_dispatch/routing/mapper.rb
--- old/lib/action_dispatch/routing/mapper.rb 2017-03-02 00:12:03.000000000
+0100
+++ new/lib/action_dispatch/routing/mapper.rb 2017-05-12 22:03:55.000000000
+0200
@@ -54,6 +54,7 @@
class Mapping #:nodoc:
ANCHOR_CHARACTERS_REGEX = %r{\A(\\A|\^)|(\\Z|\\z|\$)\Z}
+ OPTIONAL_FORMAT_REGEX = %r{(?:\(\.:format\)+|\.:format|/)\Z}
attr_reader :requirements, :defaults
attr_reader :to, :default_controller, :default_action
@@ -93,7 +94,7 @@
end
def self.optional_format?(path, format)
- format != false && !path.include?(':format') && !path.end_with?('/')
+ format != false && path !~ OPTIONAL_FORMAT_REGEX
end
def initialize(set, ast, defaults, controller, default_action,
modyoule, to, formatted, scope_constraints, blocks, via, options_constraints,
anchor, options)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/action_dispatch/routing/redirection.rb
new/lib/action_dispatch/routing/redirection.rb
--- old/lib/action_dispatch/routing/redirection.rb 2017-03-02
00:12:03.000000000 +0100
+++ new/lib/action_dispatch/routing/redirection.rb 2017-05-12
22:03:55.000000000 +0200
@@ -36,6 +36,8 @@
uri.host ||= req.host
uri.port ||= req.port unless req.standard_port?
+ req.commit_flash
+
body = %(<html><body>You are being <a
href="#{ERB::Util.unwrapped_html_escape(uri.to_s)}">redirected</a>.</body></html>)
headers = {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/action_dispatch/routing/route_set.rb
new/lib/action_dispatch/routing/route_set.rb
--- old/lib/action_dispatch/routing/route_set.rb 2017-03-02
00:12:03.000000000 +0100
+++ new/lib/action_dispatch/routing/route_set.rb 2017-05-12
22:03:55.000000000 +0200
@@ -745,8 +745,7 @@
params[key] = URI.parser.unescape(value)
end
end
- old_params = req.path_parameters
- req.path_parameters = old_params.merge params
+ req.path_parameters = params
app = route.app
if app.matches?(req) && app.dispatcher?
begin
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/action_pack/gem_version.rb
new/lib/action_pack/gem_version.rb
--- old/lib/action_pack/gem_version.rb 2017-03-02 00:12:03.000000000 +0100
+++ new/lib/action_pack/gem_version.rb 2017-05-12 22:03:55.000000000 +0200
@@ -7,7 +7,7 @@
module VERSION
MAJOR = 5
MINOR = 0
- TINY = 2
+ TINY = 3
PRE = nil
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/metadata new/metadata
--- old/metadata 2017-03-02 00:12:03.000000000 +0100
+++ new/metadata 2017-05-12 22:03:55.000000000 +0200
@@ -1,14 +1,14 @@
--- !ruby/object:Gem::Specification
name: actionpack
version: !ruby/object:Gem::Version
- version: 5.0.2
+ version: 5.0.3
platform: ruby
authors:
- David Heinemeier Hansson
autorequire:
bindir: bin
cert_chain: []
-date: 2017-03-01 00:00:00.000000000 Z
+date: 2017-05-12 00:00:00.000000000 Z
dependencies:
- !ruby/object:Gem::Dependency
name: activesupport
@@ -16,14 +16,14 @@
requirements:
- - '='
- !ruby/object:Gem::Version
- version: 5.0.2
+ version: 5.0.3
type: :runtime
prerelease: false
version_requirements: !ruby/object:Gem::Requirement
requirements:
- - '='
- !ruby/object:Gem::Version
- version: 5.0.2
+ version: 5.0.3
- !ruby/object:Gem::Dependency
name: rack
requirement: !ruby/object:Gem::Requirement
@@ -92,28 +92,28 @@
requirements:
- - '='
- !ruby/object:Gem::Version
- version: 5.0.2
+ version: 5.0.3
type: :runtime
prerelease: false
version_requirements: !ruby/object:Gem::Requirement
requirements:
- - '='
- !ruby/object:Gem::Version
- version: 5.0.2
+ version: 5.0.3
- !ruby/object:Gem::Dependency
name: activemodel
requirement: !ruby/object:Gem::Requirement
requirements:
- - '='
- !ruby/object:Gem::Version
- version: 5.0.2
+ version: 5.0.3
type: :development
prerelease: false
version_requirements: !ruby/object:Gem::Requirement
requirements:
- - '='
- !ruby/object:Gem::Version
- version: 5.0.2
+ version: 5.0.3
description: Web apps on Rails. Simple, battle-tested conventions for building
and
testing MVC web applications. Works with any Rack-compatible server.
email: [email protected]
@@ -303,3 +303,4 @@
specification_version: 4
summary: Web-flow and rendering framework putting the VC in MVC (part of
Rails).
test_files: []
+has_rdoc: