actionpack 7.0.4.3 → 7.0.5
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 +44 -1
- data/lib/abstract_controller/helpers.rb +8 -7
- data/lib/abstract_controller/rendering.rb +9 -11
- data/lib/action_controller/api.rb +1 -1
- data/lib/action_controller/metal/basic_implicit_render.rb +3 -1
- data/lib/action_controller/metal/conditional_get.rb +121 -123
- data/lib/action_controller/metal/content_security_policy.rb +4 -4
- data/lib/action_controller/metal/data_streaming.rb +18 -18
- data/lib/action_controller/metal/etag_with_flash.rb +1 -1
- data/lib/action_controller/metal/head.rb +1 -1
- data/lib/action_controller/metal/live.rb +1 -1
- data/lib/action_controller/metal/permissions_policy.rb +1 -1
- data/lib/action_controller/metal/redirecting.rb +1 -1
- data/lib/action_controller/metal/rendering.rb +114 -2
- data/lib/action_controller/metal/request_forgery_protection.rb +5 -3
- data/lib/action_controller/metal/streaming.rb +1 -1
- data/lib/action_controller/metal/url_for.rb +2 -4
- data/lib/action_controller/railtie.rb +2 -1
- data/lib/action_controller/renderer.rb +1 -20
- data/lib/action_dispatch/http/cache.rb +7 -7
- data/lib/action_dispatch/http/content_security_policy.rb +5 -1
- data/lib/action_dispatch/http/filter_parameters.rb +4 -24
- data/lib/action_dispatch/http/headers.rb +1 -1
- data/lib/action_dispatch/http/request.rb +15 -16
- data/lib/action_dispatch/http/response.rb +0 -4
- data/lib/action_dispatch/http/upload.rb +13 -2
- data/lib/action_dispatch/middleware/cookies.rb +6 -6
- data/lib/action_dispatch/middleware/remote_ip.rb +4 -4
- data/lib/action_dispatch/middleware/request_id.rb +2 -2
- data/lib/action_dispatch/middleware/static.rb +3 -3
- data/lib/action_dispatch/middleware/templates/routes/_table.html.erb +17 -8
- data/lib/action_dispatch/routing/mapper.rb +23 -0
- data/lib/action_dispatch/routing/url_for.rb +21 -21
- data/lib/action_dispatch/system_testing/driver.rb +1 -1
- data/lib/action_dispatch/testing/assertions/response.rb +1 -1
- data/lib/action_pack/gem_version.rb +2 -2
- metadata +17 -17
@@ -102,9 +102,9 @@
|
|
102
102
|
// Enables path search functionality
|
103
103
|
function setupMatchPaths() {
|
104
104
|
// Check if there are any matched results in a section
|
105
|
-
function checkNoMatch(section,
|
105
|
+
function checkNoMatch(section, trElement) {
|
106
106
|
if (section.children.length <= 1) {
|
107
|
-
section.
|
107
|
+
section.appendChild(trElement);
|
108
108
|
}
|
109
109
|
}
|
110
110
|
|
@@ -145,21 +145,30 @@
|
|
145
145
|
}
|
146
146
|
}
|
147
147
|
|
148
|
+
function buildTr(string) {
|
149
|
+
var tr = document.createElement('tr');
|
150
|
+
var th = document.createElement('th');
|
151
|
+
th.setAttribute('colspan', 4);
|
152
|
+
tr.appendChild(th);
|
153
|
+
th.innerText = string;
|
154
|
+
return tr;
|
155
|
+
}
|
156
|
+
|
148
157
|
// On key press perform a search for matching paths
|
149
158
|
delayedKeyup(searchElem, function() {
|
150
159
|
var path = sanitizePath(searchElem.value),
|
151
|
-
defaultExactMatch = '
|
152
|
-
defaultFuzzyMatch = '
|
153
|
-
noExactMatch = '
|
154
|
-
noFuzzyMatch = '
|
160
|
+
defaultExactMatch = buildTr('Paths Matching (' + path + '):'),
|
161
|
+
defaultFuzzyMatch = buildTr('Paths Containing (' + path +'):'),
|
162
|
+
noExactMatch = buildTr('No Exact Matches Found'),
|
163
|
+
noFuzzyMatch = buildTr('No Fuzzy Matches Found');
|
155
164
|
|
156
165
|
if (!path)
|
157
166
|
return searchElem.onblur();
|
158
167
|
|
159
168
|
getJSON('/rails/info/routes?path=' + path, function(matches){
|
160
169
|
// Clear out results section
|
161
|
-
exactSection.
|
162
|
-
fuzzySection.
|
170
|
+
exactSection.replaceChildren(defaultExactMatch);
|
171
|
+
fuzzySection.replaceChildren(defaultFuzzyMatch);
|
163
172
|
|
164
173
|
// Display exact matches and fuzzy matches
|
165
174
|
pathElements.forEach(function(elem) {
|
@@ -1584,6 +1584,29 @@ module ActionDispatch
|
|
1584
1584
|
!parent_resource.singleton? && @scope[:shallow]
|
1585
1585
|
end
|
1586
1586
|
|
1587
|
+
# Loads another routes file with the given +name+ located inside the
|
1588
|
+
# +config/routes+ directory. In that file, you can use the normal
|
1589
|
+
# routing DSL, but <i>do not</i> surround it with a
|
1590
|
+
# +Rails.application.routes.draw+ block.
|
1591
|
+
#
|
1592
|
+
# # config/routes.rb
|
1593
|
+
# Rails.application.routes.draw do
|
1594
|
+
# draw :admin # Loads `config/routes/admin.rb`
|
1595
|
+
# draw "third_party/some_gem" # Loads `config/routes/third_party/some_gem.rb`
|
1596
|
+
# end
|
1597
|
+
#
|
1598
|
+
# # config/routes/admin.rb
|
1599
|
+
# namespace :admin do
|
1600
|
+
# resources :accounts
|
1601
|
+
# end
|
1602
|
+
#
|
1603
|
+
# # config/routes/third_party/some_gem.rb
|
1604
|
+
# mount SomeGem::Engine, at: "/some_gem"
|
1605
|
+
#
|
1606
|
+
# <b>CAUTION:</b> Use this feature with care. Having multiple routes
|
1607
|
+
# files can negatively impact discoverability and readability. For most
|
1608
|
+
# applications — even those with a few hundred routes — it's easier for
|
1609
|
+
# developers to have a single routes file.
|
1587
1610
|
def draw(name)
|
1588
1611
|
path = @draw_paths.find do |_path|
|
1589
1612
|
File.exist? "#{_path}/#{name}.rb"
|
@@ -6,16 +6,16 @@ module ActionDispatch
|
|
6
6
|
# is also possible: a URL can be generated from one of your routing definitions.
|
7
7
|
# URL generation functionality is centralized in this module.
|
8
8
|
#
|
9
|
-
# See ActionDispatch::Routing for general information about routing and routes.rb
|
9
|
+
# See ActionDispatch::Routing for general information about routing and <tt>config/routes.rb</tt>.
|
10
10
|
#
|
11
11
|
# <b>Tip:</b> If you need to generate URLs from your models or some other place,
|
12
|
-
# then
|
12
|
+
# then ActionDispatch::Routing::UrlFor is what you're looking for. Read on for
|
13
13
|
# an introduction. In general, this module should not be included on its own,
|
14
|
-
# as it is usually included by url_helpers (as in Rails.application.routes.url_helpers).
|
14
|
+
# as it is usually included by +url_helpers+ (as in <tt>Rails.application.routes.url_helpers</tt>).
|
15
15
|
#
|
16
16
|
# == URL generation from parameters
|
17
17
|
#
|
18
|
-
# As you may know, some functions, such as ActionController::Base#url_for
|
18
|
+
# As you may know, some functions, such as <tt>ActionController::Base#url_for</tt>
|
19
19
|
# and ActionView::Helpers::UrlHelper#link_to, can generate URLs given a set
|
20
20
|
# of parameters. For example, you've probably had the chance to write code
|
21
21
|
# like this in one of your views:
|
@@ -24,12 +24,12 @@ module ActionDispatch
|
|
24
24
|
# action: 'new', message: 'Welcome!') %>
|
25
25
|
# # => <a href="/users/new?message=Welcome%21">Click here</a>
|
26
26
|
#
|
27
|
-
# link_to
|
28
|
-
# actually use
|
29
|
-
# they use the
|
27
|
+
# +link_to+, and all other functions that require URL generation functionality,
|
28
|
+
# actually use ActionDispatch::Routing::UrlFor under the hood. And in particular,
|
29
|
+
# they use the ActionDispatch::Routing::UrlFor#url_for method. One can generate
|
30
30
|
# the same path as the above example by using the following code:
|
31
31
|
#
|
32
|
-
# include UrlFor
|
32
|
+
# include ActionDispatch::Routing::UrlFor
|
33
33
|
# url_for(controller: 'users',
|
34
34
|
# action: 'new',
|
35
35
|
# message: 'Welcome!',
|
@@ -48,17 +48,17 @@ module ActionDispatch
|
|
48
48
|
# host: 'www.example.com')
|
49
49
|
# # => "http://www.example.com/users/new?message=Welcome%21"
|
50
50
|
#
|
51
|
-
# By default, all controllers and views have access to a special version of url_for
|
52
|
-
# that already knows what the current hostname is. So if you use url_for in your
|
51
|
+
# By default, all controllers and views have access to a special version of +url_for+,
|
52
|
+
# that already knows what the current hostname is. So if you use +url_for+ in your
|
53
53
|
# controllers or your views, then you don't need to explicitly pass the <tt>:host</tt>
|
54
54
|
# argument.
|
55
55
|
#
|
56
|
-
# For convenience
|
57
|
-
#
|
58
|
-
#
|
59
|
-
# the +:host+
|
60
|
-
#
|
61
|
-
#
|
56
|
+
# For convenience, mailers also include ActionDispatch::Routing::UrlFor. So
|
57
|
+
# within mailers, you can use url_for. However, mailers cannot access
|
58
|
+
# incoming web requests in order to derive hostname information, so you have
|
59
|
+
# to provide the +:host+ option or set the default host using
|
60
|
+
# +default_url_options+. For more information on url_for in mailers see the
|
61
|
+
# ActionMailer::Base documentation.
|
62
62
|
#
|
63
63
|
#
|
64
64
|
# == URL generation for named routes
|
@@ -72,7 +72,7 @@ module ActionDispatch
|
|
72
72
|
# This generates, among other things, the method <tt>users_path</tt>. By default,
|
73
73
|
# this method is accessible from your controllers, views, and mailers. If you need
|
74
74
|
# to access this auto-generated method from other places (such as a model), then
|
75
|
-
# you can do that by including Rails.application.routes.url_helpers in your class:
|
75
|
+
# you can do that by including <tt>Rails.application.routes.url_helpers</tt> in your class:
|
76
76
|
#
|
77
77
|
# class User < ActiveRecord::Base
|
78
78
|
# include Rails.application.routes.url_helpers
|
@@ -115,11 +115,11 @@ module ActionDispatch
|
|
115
115
|
default_url_options
|
116
116
|
end
|
117
117
|
|
118
|
-
# Generate a URL based on the options provided, default_url_options
|
119
|
-
# routes defined in routes.rb
|
118
|
+
# Generate a URL based on the options provided, +default_url_options+, and the
|
119
|
+
# routes defined in <tt>config/routes.rb</tt>. The following options are supported:
|
120
120
|
#
|
121
121
|
# * <tt>:only_path</tt> - If true, the relative URL is returned. Defaults to +false+.
|
122
|
-
# * <tt>:protocol</tt> - The protocol to connect to. Defaults to
|
122
|
+
# * <tt>:protocol</tt> - The protocol to connect to. Defaults to <tt>"http"</tt>.
|
123
123
|
# * <tt>:host</tt> - Specifies the host the link should be targeted at.
|
124
124
|
# If <tt>:only_path</tt> is false, this option must be
|
125
125
|
# provided either explicitly, or via +default_url_options+.
|
@@ -134,7 +134,7 @@ module ActionDispatch
|
|
134
134
|
# * <tt>:port</tt> - Optionally specify the port to connect to.
|
135
135
|
# * <tt>:anchor</tt> - An anchor name to be appended to the path.
|
136
136
|
# * <tt>:params</tt> - The query parameters to be appended to the path.
|
137
|
-
# * <tt>:trailing_slash</tt> - If true, adds a trailing slash, as in "/archive/2009/"
|
137
|
+
# * <tt>:trailing_slash</tt> - If true, adds a trailing slash, as in <tt>"/archive/2009/"</tt>.
|
138
138
|
# * <tt>:script_name</tt> - Specifies application path relative to domain root. If provided, prepends application path.
|
139
139
|
#
|
140
140
|
# Any other key (<tt>:controller</tt>, <tt>:action</tt>, etc.) given to
|
@@ -20,7 +20,7 @@ module ActionDispatch
|
|
20
20
|
#
|
21
21
|
# You can also pass an explicit status number like <tt>assert_response(501)</tt>
|
22
22
|
# or its symbolic equivalent <tt>assert_response(:not_implemented)</tt>.
|
23
|
-
# See Rack::Utils::SYMBOL_TO_STATUS_CODE for a full list.
|
23
|
+
# See +Rack::Utils::SYMBOL_TO_STATUS_CODE+ for a full list.
|
24
24
|
#
|
25
25
|
# # Asserts that the response was a redirection
|
26
26
|
# assert_response :redirect
|
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: 7.0.
|
4
|
+
version: 7.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Heinemeier Hansson
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-05-24 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: 7.0.
|
19
|
+
version: 7.0.5
|
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: 7.0.
|
26
|
+
version: 7.0.5
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rack
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -33,7 +33,7 @@ dependencies:
|
|
33
33
|
version: '2.0'
|
34
34
|
- - ">="
|
35
35
|
- !ruby/object:Gem::Version
|
36
|
-
version: 2.2.
|
36
|
+
version: 2.2.4
|
37
37
|
type: :runtime
|
38
38
|
prerelease: false
|
39
39
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -43,7 +43,7 @@ dependencies:
|
|
43
43
|
version: '2.0'
|
44
44
|
- - ">="
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: 2.2.
|
46
|
+
version: 2.2.4
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: rack-test
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -98,28 +98,28 @@ dependencies:
|
|
98
98
|
requirements:
|
99
99
|
- - '='
|
100
100
|
- !ruby/object:Gem::Version
|
101
|
-
version: 7.0.
|
101
|
+
version: 7.0.5
|
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: 7.0.
|
108
|
+
version: 7.0.5
|
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: 7.0.
|
115
|
+
version: 7.0.5
|
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: 7.0.
|
122
|
+
version: 7.0.5
|
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
|
@@ -310,12 +310,12 @@ licenses:
|
|
310
310
|
- MIT
|
311
311
|
metadata:
|
312
312
|
bug_tracker_uri: https://github.com/rails/rails/issues
|
313
|
-
changelog_uri: https://github.com/rails/rails/blob/v7.0.
|
314
|
-
documentation_uri: https://api.rubyonrails.org/v7.0.
|
313
|
+
changelog_uri: https://github.com/rails/rails/blob/v7.0.5/actionpack/CHANGELOG.md
|
314
|
+
documentation_uri: https://api.rubyonrails.org/v7.0.5/
|
315
315
|
mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
|
316
|
-
source_code_uri: https://github.com/rails/rails/tree/v7.0.
|
316
|
+
source_code_uri: https://github.com/rails/rails/tree/v7.0.5/actionpack
|
317
317
|
rubygems_mfa_required: 'true'
|
318
|
-
post_install_message:
|
318
|
+
post_install_message:
|
319
319
|
rdoc_options: []
|
320
320
|
require_paths:
|
321
321
|
- lib
|
@@ -331,8 +331,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
331
331
|
version: '0'
|
332
332
|
requirements:
|
333
333
|
- none
|
334
|
-
rubygems_version: 3.4.
|
335
|
-
signing_key:
|
334
|
+
rubygems_version: 3.4.10
|
335
|
+
signing_key:
|
336
336
|
specification_version: 4
|
337
337
|
summary: Web-flow and rendering framework putting the VC in MVC (part of Rails).
|
338
338
|
test_files: []
|