actionpack 6.0.4.7 → 6.1.0.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 +235 -331
- data/MIT-LICENSE +1 -1
- data/README.rdoc +1 -1
- data/lib/abstract_controller/base.rb +35 -2
- data/lib/abstract_controller/callbacks.rb +2 -2
- data/lib/abstract_controller/helpers.rb +105 -90
- data/lib/abstract_controller/rendering.rb +9 -9
- data/lib/abstract_controller/translation.rb +8 -2
- data/lib/abstract_controller.rb +1 -0
- data/lib/action_controller/api.rb +2 -2
- data/lib/action_controller/base.rb +4 -2
- data/lib/action_controller/caching.rb +0 -1
- data/lib/action_controller/log_subscriber.rb +3 -3
- data/lib/action_controller/metal/conditional_get.rb +10 -2
- data/lib/action_controller/metal/content_security_policy.rb +1 -1
- data/lib/action_controller/metal/data_streaming.rb +1 -1
- data/lib/action_controller/metal/etag_with_template_digest.rb +2 -4
- data/lib/action_controller/metal/exceptions.rb +33 -0
- data/lib/action_controller/metal/feature_policy.rb +46 -0
- data/lib/action_controller/metal/head.rb +7 -4
- data/lib/action_controller/metal/helpers.rb +11 -1
- data/lib/action_controller/metal/http_authentication.rb +5 -3
- data/lib/action_controller/metal/implicit_render.rb +1 -1
- data/lib/action_controller/metal/instrumentation.rb +11 -9
- data/lib/action_controller/metal/live.rb +1 -1
- data/lib/action_controller/metal/logging.rb +20 -0
- data/lib/action_controller/metal/mime_responds.rb +6 -2
- data/lib/action_controller/metal/parameter_encoding.rb +35 -4
- data/lib/action_controller/metal/params_wrapper.rb +16 -11
- data/lib/action_controller/metal/redirecting.rb +1 -1
- data/lib/action_controller/metal/rendering.rb +6 -0
- data/lib/action_controller/metal/request_forgery_protection.rb +1 -1
- data/lib/action_controller/metal/rescue.rb +1 -1
- data/lib/action_controller/metal/strong_parameters.rb +103 -15
- data/lib/action_controller/metal.rb +2 -2
- data/lib/action_controller/renderer.rb +24 -13
- data/lib/action_controller/test_case.rb +62 -56
- data/lib/action_controller.rb +2 -3
- data/lib/action_dispatch/http/cache.rb +12 -10
- data/lib/action_dispatch/http/content_security_policy.rb +5 -1
- data/lib/action_dispatch/http/feature_policy.rb +168 -0
- data/lib/action_dispatch/http/filter_parameters.rb +1 -1
- data/lib/action_dispatch/http/filter_redirect.rb +1 -1
- data/lib/action_dispatch/http/headers.rb +3 -2
- data/lib/action_dispatch/http/mime_negotiation.rb +14 -8
- data/lib/action_dispatch/http/mime_type.rb +29 -16
- data/lib/action_dispatch/http/parameters.rb +1 -19
- data/lib/action_dispatch/http/request.rb +24 -8
- data/lib/action_dispatch/http/response.rb +17 -16
- data/lib/action_dispatch/http/url.rb +3 -2
- data/lib/action_dispatch/journey/formatter.rb +53 -28
- data/lib/action_dispatch/journey/gtg/builder.rb +22 -36
- data/lib/action_dispatch/journey/gtg/simulator.rb +8 -7
- data/lib/action_dispatch/journey/gtg/transition_table.rb +6 -4
- data/lib/action_dispatch/journey/nfa/dot.rb +0 -11
- data/lib/action_dispatch/journey/nodes/node.rb +4 -3
- data/lib/action_dispatch/journey/parser.rb +13 -13
- data/lib/action_dispatch/journey/parser.y +1 -1
- data/lib/action_dispatch/journey/path/pattern.rb +13 -18
- data/lib/action_dispatch/journey/route.rb +7 -18
- data/lib/action_dispatch/journey/router/utils.rb +6 -4
- data/lib/action_dispatch/journey/router.rb +26 -30
- data/lib/action_dispatch/journey.rb +0 -2
- data/lib/action_dispatch/middleware/actionable_exceptions.rb +1 -1
- data/lib/action_dispatch/middleware/cookies.rb +67 -32
- data/lib/action_dispatch/middleware/debug_exceptions.rb +8 -15
- data/lib/action_dispatch/middleware/debug_view.rb +1 -1
- data/lib/action_dispatch/middleware/exception_wrapper.rb +28 -16
- data/lib/action_dispatch/middleware/executor.rb +1 -1
- data/lib/action_dispatch/middleware/host_authorization.rb +35 -35
- data/lib/action_dispatch/middleware/remote_ip.rb +5 -4
- data/lib/action_dispatch/middleware/request_id.rb +4 -5
- data/lib/action_dispatch/middleware/session/abstract_store.rb +2 -2
- data/lib/action_dispatch/middleware/session/cookie_store.rb +2 -2
- data/lib/action_dispatch/middleware/ssl.rb +9 -6
- data/lib/action_dispatch/middleware/stack.rb +18 -0
- data/lib/action_dispatch/middleware/static.rb +154 -93
- data/lib/action_dispatch/middleware/templates/rescues/_message_and_suggestions.html.erb +18 -0
- data/lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb +2 -5
- data/lib/action_dispatch/middleware/templates/rescues/invalid_statement.html.erb +2 -2
- data/lib/action_dispatch/middleware/templates/rescues/invalid_statement.text.erb +2 -3
- data/lib/action_dispatch/middleware/templates/rescues/layout.erb +88 -8
- data/lib/action_dispatch/middleware/templates/rescues/unknown_action.html.erb +1 -1
- data/lib/action_dispatch/middleware/templates/routes/_table.html.erb +12 -1
- data/lib/action_dispatch/railtie.rb +3 -2
- data/lib/action_dispatch/request/session.rb +2 -8
- data/lib/action_dispatch/request/utils.rb +26 -2
- data/lib/action_dispatch/routing/inspector.rb +8 -7
- data/lib/action_dispatch/routing/mapper.rb +102 -71
- data/lib/action_dispatch/routing/polymorphic_routes.rb +16 -19
- data/lib/action_dispatch/routing/redirection.rb +3 -3
- data/lib/action_dispatch/routing/route_set.rb +49 -41
- data/lib/action_dispatch/system_test_case.rb +29 -24
- data/lib/action_dispatch/system_testing/browser.rb +33 -27
- data/lib/action_dispatch/system_testing/driver.rb +6 -7
- data/lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb +47 -6
- data/lib/action_dispatch/system_testing/test_helpers/setup_and_teardown.rb +4 -7
- data/lib/action_dispatch/testing/assertions/response.rb +2 -4
- data/lib/action_dispatch/testing/assertions/routing.rb +5 -5
- data/lib/action_dispatch/testing/assertions.rb +1 -1
- data/lib/action_dispatch/testing/integration.rb +38 -27
- data/lib/action_dispatch/testing/test_process.rb +29 -4
- data/lib/action_dispatch/testing/test_request.rb +3 -3
- data/lib/action_dispatch.rb +3 -2
- data/lib/action_pack/gem_version.rb +3 -3
- data/lib/action_pack.rb +1 -1
- metadata +23 -24
- data/lib/action_controller/metal/force_ssl.rb +0 -58
- data/lib/action_dispatch/http/parameter_filter.rb +0 -12
- data/lib/action_dispatch/journey/nfa/builder.rb +0 -78
- data/lib/action_dispatch/journey/nfa/simulator.rb +0 -47
- data/lib/action_dispatch/journey/nfa/transition_table.rb +0 -119
@@ -2,8 +2,6 @@
|
|
2
2
|
|
3
3
|
require "stringio"
|
4
4
|
require "uri"
|
5
|
-
require "active_support/core_ext/kernel/singleton_class"
|
6
|
-
require "active_support/core_ext/object/try"
|
7
5
|
require "rack/test"
|
8
6
|
require "minitest"
|
9
7
|
|
@@ -48,13 +46,29 @@ module ActionDispatch
|
|
48
46
|
process(:head, path, **args)
|
49
47
|
end
|
50
48
|
|
49
|
+
# Performs an OPTIONS request with the given parameters. See ActionDispatch::Integration::Session#process
|
50
|
+
# for more details.
|
51
|
+
def options(path, **args)
|
52
|
+
process(:options, path, **args)
|
53
|
+
end
|
54
|
+
|
51
55
|
# Follow a single redirect response. If the last response was not a
|
52
56
|
# redirect, an exception will be raised. Otherwise, the redirect is
|
53
|
-
# performed on the location header.
|
54
|
-
#
|
57
|
+
# performed on the location header. If the redirection is a 307 or 308 redirect,
|
58
|
+
# the same HTTP verb will be used when redirecting, otherwise a GET request
|
59
|
+
# will be performed. Any arguments are passed to the
|
60
|
+
# underlying request.
|
55
61
|
def follow_redirect!(**args)
|
56
62
|
raise "not a redirect! #{status} #{status_message}" unless redirect?
|
57
|
-
|
63
|
+
|
64
|
+
method =
|
65
|
+
if [307, 308].include?(response.status)
|
66
|
+
request.method.downcase
|
67
|
+
else
|
68
|
+
:get
|
69
|
+
end
|
70
|
+
|
71
|
+
public_send(method, response.location, **args)
|
58
72
|
status
|
59
73
|
end
|
60
74
|
end
|
@@ -73,13 +87,8 @@ module ActionDispatch
|
|
73
87
|
include Minitest::Assertions
|
74
88
|
include TestProcess, RequestHelpers, Assertions
|
75
89
|
|
76
|
-
|
77
|
-
|
78
|
-
end
|
79
|
-
|
80
|
-
%w( path ).each do |method|
|
81
|
-
delegate method, to: :request, allow_nil: true
|
82
|
-
end
|
90
|
+
delegate :status, :status_message, :headers, :body, :redirect?, to: :response, allow_nil: true
|
91
|
+
delegate :path, to: :request, allow_nil: true
|
83
92
|
|
84
93
|
# The hostname used in the last request.
|
85
94
|
def host
|
@@ -123,7 +132,7 @@ module ActionDispatch
|
|
123
132
|
|
124
133
|
def url_options
|
125
134
|
@url_options ||= default_url_options.dup.tap do |url_options|
|
126
|
-
url_options.reverse_merge!(controller.url_options) if controller
|
135
|
+
url_options.reverse_merge!(controller.url_options) if controller.respond_to?(:url_options)
|
127
136
|
|
128
137
|
if @app.respond_to?(:routes)
|
129
138
|
url_options.reverse_merge!(@app.routes.default_url_options)
|
@@ -349,20 +358,22 @@ module ActionDispatch
|
|
349
358
|
end
|
350
359
|
|
351
360
|
%w(get post patch put head delete cookies assigns follow_redirect!).each do |method|
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
end
|
361
|
+
# reset the html_document variable, except for cookies/assigns calls
|
362
|
+
unless method == "cookies" || method == "assigns"
|
363
|
+
reset_html_document = "@html_document = nil"
|
364
|
+
end
|
357
365
|
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
366
|
+
definition = RUBY_VERSION >= "2.7" ? "..." : "*args"
|
367
|
+
|
368
|
+
module_eval <<~RUBY, __FILE__, __LINE__ + 1
|
369
|
+
def #{method}(#{definition})
|
370
|
+
#{reset_html_document}
|
371
|
+
|
372
|
+
result = integration_session.#{method}(#{definition})
|
373
|
+
copy_session_variables!
|
374
|
+
result
|
362
375
|
end
|
363
|
-
|
364
|
-
result
|
365
|
-
end
|
376
|
+
RUBY
|
366
377
|
end
|
367
378
|
|
368
379
|
# Open a new session instance. If a block is given, the new session is
|
@@ -506,7 +517,7 @@ module ActionDispatch
|
|
506
517
|
#
|
507
518
|
# A simple integration test that exercises multiple controllers:
|
508
519
|
#
|
509
|
-
# require
|
520
|
+
# require "test_helper"
|
510
521
|
#
|
511
522
|
# class UserFlowsTest < ActionDispatch::IntegrationTest
|
512
523
|
# test "login and browse site" do
|
@@ -535,7 +546,7 @@ module ActionDispatch
|
|
535
546
|
#
|
536
547
|
# Here's an example of multiple sessions and custom DSL in an integration test
|
537
548
|
#
|
538
|
-
# require
|
549
|
+
# require "test_helper"
|
539
550
|
#
|
540
551
|
# class UserFlowsTest < ActionDispatch::IntegrationTest
|
541
552
|
# test "login and browse site" do
|
@@ -6,19 +6,44 @@ require "action_dispatch/middleware/flash"
|
|
6
6
|
module ActionDispatch
|
7
7
|
module TestProcess
|
8
8
|
module FixtureFile
|
9
|
-
# Shortcut for <tt>Rack::Test::UploadedFile.new(File.join(ActionDispatch::IntegrationTest.
|
9
|
+
# Shortcut for <tt>Rack::Test::UploadedFile.new(File.join(ActionDispatch::IntegrationTest.file_fixture_path, path), type)</tt>:
|
10
10
|
#
|
11
|
-
# post :change_avatar, params: { avatar: fixture_file_upload('
|
11
|
+
# post :change_avatar, params: { avatar: fixture_file_upload('spongebob.png', 'image/png') }
|
12
|
+
#
|
13
|
+
# Default fixture files location is <tt>test/fixtures/files</tt>.
|
12
14
|
#
|
13
15
|
# To upload binary files on Windows, pass <tt>:binary</tt> as the last parameter.
|
14
16
|
# This will not affect other platforms:
|
15
17
|
#
|
16
|
-
# post :change_avatar, params: { avatar: fixture_file_upload('
|
18
|
+
# post :change_avatar, params: { avatar: fixture_file_upload('spongebob.png', 'image/png', :binary) }
|
17
19
|
def fixture_file_upload(path, mime_type = nil, binary = false)
|
18
20
|
if self.class.respond_to?(:fixture_path) && self.class.fixture_path &&
|
19
21
|
!File.exist?(path)
|
20
|
-
|
22
|
+
original_path = path
|
23
|
+
path = Pathname.new(self.class.fixture_path).join(path)
|
24
|
+
|
25
|
+
if !self.class.file_fixture_path
|
26
|
+
ActiveSupport::Deprecation.warn(<<~EOM)
|
27
|
+
Passing a path to `fixture_file_upload` relative to `fixture_path` is deprecated.
|
28
|
+
In Rails 6.2, the path needs to be relative to `file_fixture_path` which you
|
29
|
+
haven't set yet. Set `file_fixture_path` to discard this warning.
|
30
|
+
EOM
|
31
|
+
elsif path.exist?
|
32
|
+
non_deprecated_path = path.relative_path_from(Pathname(self.class.file_fixture_path))
|
33
|
+
ActiveSupport::Deprecation.warn(<<~EOM)
|
34
|
+
Passing a path to `fixture_file_upload` relative to `fixture_path` is deprecated.
|
35
|
+
In Rails 6.2, the path needs to be relative to `file_fixture_path`.
|
36
|
+
|
37
|
+
Please modify the call from
|
38
|
+
`fixture_file_upload("#{original_path}")` to `fixture_file_upload("#{non_deprecated_path}")`.
|
39
|
+
EOM
|
40
|
+
else
|
41
|
+
path = file_fixture(original_path)
|
42
|
+
end
|
43
|
+
elsif self.class.file_fixture_path && !File.exist?(path)
|
44
|
+
path = file_fixture(path)
|
21
45
|
end
|
46
|
+
|
22
47
|
Rack::Test::UploadedFile.new(path, mime_type, binary)
|
23
48
|
end
|
24
49
|
end
|
@@ -6,9 +6,9 @@ require "rack/utils"
|
|
6
6
|
module ActionDispatch
|
7
7
|
class TestRequest < Request
|
8
8
|
DEFAULT_ENV = Rack::MockRequest.env_for("/",
|
9
|
-
"HTTP_HOST" => "test.host",
|
10
|
-
"REMOTE_ADDR" => "0.0.0.0",
|
11
|
-
"HTTP_USER_AGENT" => "Rails Testing",
|
9
|
+
"HTTP_HOST" => "test.host".b,
|
10
|
+
"REMOTE_ADDR" => "0.0.0.0".b,
|
11
|
+
"HTTP_USER_AGENT" => "Rails Testing".b,
|
12
12
|
)
|
13
13
|
|
14
14
|
# Create a new test request with default +env+ values.
|
data/lib/action_dispatch.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
#--
|
4
|
-
# Copyright (c) 2004-
|
4
|
+
# Copyright (c) 2004-2020 David Heinemeier Hansson
|
5
5
|
#
|
6
6
|
# Permission is hereby granted, free of charge, to any person obtaining
|
7
7
|
# a copy of this software and associated documentation files (the
|
@@ -46,6 +46,7 @@ module ActionDispatch
|
|
46
46
|
eager_autoload do
|
47
47
|
autoload_under "http" do
|
48
48
|
autoload :ContentSecurityPolicy
|
49
|
+
autoload :FeaturePolicy
|
49
50
|
autoload :Request
|
50
51
|
autoload :Response
|
51
52
|
end
|
@@ -82,7 +83,6 @@ module ActionDispatch
|
|
82
83
|
autoload :Headers
|
83
84
|
autoload :MimeNegotiation
|
84
85
|
autoload :Parameters
|
85
|
-
autoload :ParameterFilter
|
86
86
|
autoload :UploadedFile, "action_dispatch/http/upload"
|
87
87
|
autoload :URL
|
88
88
|
end
|
@@ -115,4 +115,5 @@ autoload :Mime, "action_dispatch/http/mime_type"
|
|
115
115
|
ActiveSupport.on_load(:action_view) do
|
116
116
|
ActionView::Base.default_formats ||= Mime::SET.symbols
|
117
117
|
ActionView::Template::Types.delegate_to Mime
|
118
|
+
ActionView::LookupContext::DetailsKey.clear
|
118
119
|
end
|
data/lib/action_pack.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
#--
|
4
|
-
# Copyright (c) 2004-
|
4
|
+
# Copyright (c) 2004-2020 David Heinemeier Hansson
|
5
5
|
#
|
6
6
|
# Permission is hereby granted, free of charge, to any person obtaining
|
7
7
|
# a copy of this software and associated documentation files (the
|
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: 6.0.
|
4
|
+
version: 6.1.0.rc1
|
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:
|
11
|
+
date: 2020-11-02 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: 6.0.
|
19
|
+
version: 6.1.0.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: 6.0.
|
26
|
+
version: 6.1.0.rc1
|
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.0.
|
36
|
+
version: 2.0.9
|
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.0.
|
46
|
+
version: 2.0.9
|
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: 6.0.
|
101
|
+
version: 6.1.0.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: 6.0.
|
108
|
+
version: 6.1.0.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: 6.0.
|
115
|
+
version: 6.1.0.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: 6.0.
|
122
|
+
version: 6.1.0.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
|
@@ -161,14 +161,15 @@ files:
|
|
161
161
|
- lib/action_controller/metal/etag_with_flash.rb
|
162
162
|
- lib/action_controller/metal/etag_with_template_digest.rb
|
163
163
|
- lib/action_controller/metal/exceptions.rb
|
164
|
+
- lib/action_controller/metal/feature_policy.rb
|
164
165
|
- lib/action_controller/metal/flash.rb
|
165
|
-
- lib/action_controller/metal/force_ssl.rb
|
166
166
|
- lib/action_controller/metal/head.rb
|
167
167
|
- lib/action_controller/metal/helpers.rb
|
168
168
|
- lib/action_controller/metal/http_authentication.rb
|
169
169
|
- lib/action_controller/metal/implicit_render.rb
|
170
170
|
- lib/action_controller/metal/instrumentation.rb
|
171
171
|
- lib/action_controller/metal/live.rb
|
172
|
+
- lib/action_controller/metal/logging.rb
|
172
173
|
- lib/action_controller/metal/mime_responds.rb
|
173
174
|
- lib/action_controller/metal/parameter_encoding.rb
|
174
175
|
- lib/action_controller/metal/params_wrapper.rb
|
@@ -190,13 +191,13 @@ files:
|
|
190
191
|
- lib/action_dispatch/http/cache.rb
|
191
192
|
- lib/action_dispatch/http/content_disposition.rb
|
192
193
|
- lib/action_dispatch/http/content_security_policy.rb
|
194
|
+
- lib/action_dispatch/http/feature_policy.rb
|
193
195
|
- lib/action_dispatch/http/filter_parameters.rb
|
194
196
|
- lib/action_dispatch/http/filter_redirect.rb
|
195
197
|
- lib/action_dispatch/http/headers.rb
|
196
198
|
- lib/action_dispatch/http/mime_negotiation.rb
|
197
199
|
- lib/action_dispatch/http/mime_type.rb
|
198
200
|
- lib/action_dispatch/http/mime_types.rb
|
199
|
-
- lib/action_dispatch/http/parameter_filter.rb
|
200
201
|
- lib/action_dispatch/http/parameters.rb
|
201
202
|
- lib/action_dispatch/http/rack_cache.rb
|
202
203
|
- lib/action_dispatch/http/request.rb
|
@@ -208,10 +209,7 @@ files:
|
|
208
209
|
- lib/action_dispatch/journey/gtg/builder.rb
|
209
210
|
- lib/action_dispatch/journey/gtg/simulator.rb
|
210
211
|
- lib/action_dispatch/journey/gtg/transition_table.rb
|
211
|
-
- lib/action_dispatch/journey/nfa/builder.rb
|
212
212
|
- lib/action_dispatch/journey/nfa/dot.rb
|
213
|
-
- lib/action_dispatch/journey/nfa/simulator.rb
|
214
|
-
- lib/action_dispatch/journey/nfa/transition_table.rb
|
215
213
|
- lib/action_dispatch/journey/nodes/node.rb
|
216
214
|
- lib/action_dispatch/journey/parser.rb
|
217
215
|
- lib/action_dispatch/journey/parser.y
|
@@ -250,6 +248,7 @@ files:
|
|
250
248
|
- lib/action_dispatch/middleware/static.rb
|
251
249
|
- lib/action_dispatch/middleware/templates/rescues/_actions.html.erb
|
252
250
|
- lib/action_dispatch/middleware/templates/rescues/_actions.text.erb
|
251
|
+
- lib/action_dispatch/middleware/templates/rescues/_message_and_suggestions.html.erb
|
253
252
|
- lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb
|
254
253
|
- lib/action_dispatch/middleware/templates/rescues/_request_and_response.text.erb
|
255
254
|
- lib/action_dispatch/middleware/templates/rescues/_source.html.erb
|
@@ -310,11 +309,11 @@ licenses:
|
|
310
309
|
- MIT
|
311
310
|
metadata:
|
312
311
|
bug_tracker_uri: https://github.com/rails/rails/issues
|
313
|
-
changelog_uri: https://github.com/rails/rails/blob/v6.0.
|
314
|
-
documentation_uri: https://api.rubyonrails.org/v6.0.
|
312
|
+
changelog_uri: https://github.com/rails/rails/blob/v6.1.0.rc1/actionpack/CHANGELOG.md
|
313
|
+
documentation_uri: https://api.rubyonrails.org/v6.1.0.rc1/
|
315
314
|
mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
|
316
|
-
source_code_uri: https://github.com/rails/rails/tree/v6.0.
|
317
|
-
post_install_message:
|
315
|
+
source_code_uri: https://github.com/rails/rails/tree/v6.1.0.rc1/actionpack
|
316
|
+
post_install_message:
|
318
317
|
rdoc_options: []
|
319
318
|
require_paths:
|
320
319
|
- lib
|
@@ -325,13 +324,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
325
324
|
version: 2.5.0
|
326
325
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
327
326
|
requirements:
|
328
|
-
- - "
|
327
|
+
- - ">"
|
329
328
|
- !ruby/object:Gem::Version
|
330
|
-
version:
|
329
|
+
version: 1.3.1
|
331
330
|
requirements:
|
332
331
|
- none
|
333
|
-
rubygems_version: 3.1.
|
334
|
-
signing_key:
|
332
|
+
rubygems_version: 3.1.4
|
333
|
+
signing_key:
|
335
334
|
specification_version: 4
|
336
335
|
summary: Web-flow and rendering framework putting the VC in MVC (part of Rails).
|
337
336
|
test_files: []
|
@@ -1,58 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "active_support/core_ext/hash/except"
|
4
|
-
require "active_support/core_ext/hash/slice"
|
5
|
-
|
6
|
-
module ActionController
|
7
|
-
# This module is deprecated in favor of +config.force_ssl+ in your environment
|
8
|
-
# config file. This will ensure all endpoints not explicitly marked otherwise
|
9
|
-
# will have all communication served over HTTPS.
|
10
|
-
module ForceSSL # :nodoc:
|
11
|
-
extend ActiveSupport::Concern
|
12
|
-
include AbstractController::Callbacks
|
13
|
-
|
14
|
-
ACTION_OPTIONS = [:only, :except, :if, :unless]
|
15
|
-
URL_OPTIONS = [:protocol, :host, :domain, :subdomain, :port, :path]
|
16
|
-
REDIRECT_OPTIONS = [:status, :flash, :alert, :notice]
|
17
|
-
|
18
|
-
module ClassMethods # :nodoc:
|
19
|
-
def force_ssl(options = {})
|
20
|
-
ActiveSupport::Deprecation.warn(<<-MESSAGE.squish)
|
21
|
-
Controller-level `force_ssl` is deprecated and will be removed from
|
22
|
-
Rails 6.1. Please enable `config.force_ssl` in your environment
|
23
|
-
configuration to enable the ActionDispatch::SSL middleware to more
|
24
|
-
fully enforce that your application communicate over HTTPS. If needed,
|
25
|
-
you can use `config.ssl_options` to exempt matching endpoints from
|
26
|
-
being redirected to HTTPS.
|
27
|
-
MESSAGE
|
28
|
-
|
29
|
-
action_options = options.slice(*ACTION_OPTIONS)
|
30
|
-
redirect_options = options.except(*ACTION_OPTIONS)
|
31
|
-
before_action(action_options) do
|
32
|
-
force_ssl_redirect(redirect_options)
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
def force_ssl_redirect(host_or_options = nil)
|
38
|
-
unless request.ssl?
|
39
|
-
options = {
|
40
|
-
protocol: "https://",
|
41
|
-
host: request.host,
|
42
|
-
path: request.fullpath,
|
43
|
-
status: :moved_permanently,
|
44
|
-
}
|
45
|
-
|
46
|
-
if host_or_options.is_a?(Hash)
|
47
|
-
options.merge!(host_or_options)
|
48
|
-
elsif host_or_options
|
49
|
-
options[:host] = host_or_options
|
50
|
-
end
|
51
|
-
|
52
|
-
secure_url = ActionDispatch::Http::URL.url_for(options.slice(*URL_OPTIONS))
|
53
|
-
flash.keep if respond_to?(:flash) && request.respond_to?(:flash)
|
54
|
-
redirect_to secure_url, options.slice(*REDIRECT_OPTIONS)
|
55
|
-
end
|
56
|
-
end
|
57
|
-
end
|
58
|
-
end
|
@@ -1,12 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "active_support/deprecation/constant_accessor"
|
4
|
-
require "active_support/parameter_filter"
|
5
|
-
|
6
|
-
module ActionDispatch
|
7
|
-
module Http
|
8
|
-
include ActiveSupport::Deprecation::DeprecatedConstantAccessor
|
9
|
-
deprecate_constant "ParameterFilter", "ActiveSupport::ParameterFilter",
|
10
|
-
message: "ActionDispatch::Http::ParameterFilter is deprecated and will be removed from Rails 6.1. Use ActiveSupport::ParameterFilter instead."
|
11
|
-
end
|
12
|
-
end
|
@@ -1,78 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "action_dispatch/journey/nfa/transition_table"
|
4
|
-
require "action_dispatch/journey/gtg/transition_table"
|
5
|
-
|
6
|
-
module ActionDispatch
|
7
|
-
module Journey # :nodoc:
|
8
|
-
module NFA # :nodoc:
|
9
|
-
class Visitor < Visitors::Visitor # :nodoc:
|
10
|
-
def initialize(tt)
|
11
|
-
@tt = tt
|
12
|
-
@i = -1
|
13
|
-
end
|
14
|
-
|
15
|
-
def visit_CAT(node)
|
16
|
-
left = visit(node.left)
|
17
|
-
right = visit(node.right)
|
18
|
-
|
19
|
-
@tt.merge(left.last, right.first)
|
20
|
-
|
21
|
-
[left.first, right.last]
|
22
|
-
end
|
23
|
-
|
24
|
-
def visit_GROUP(node)
|
25
|
-
from = @i += 1
|
26
|
-
left = visit(node.left)
|
27
|
-
to = @i += 1
|
28
|
-
|
29
|
-
@tt.accepting = to
|
30
|
-
|
31
|
-
@tt[from, left.first] = nil
|
32
|
-
@tt[left.last, to] = nil
|
33
|
-
@tt[from, to] = nil
|
34
|
-
|
35
|
-
[from, to]
|
36
|
-
end
|
37
|
-
|
38
|
-
def visit_OR(node)
|
39
|
-
from = @i += 1
|
40
|
-
children = node.children.map { |c| visit(c) }
|
41
|
-
to = @i += 1
|
42
|
-
|
43
|
-
children.each do |child|
|
44
|
-
@tt[from, child.first] = nil
|
45
|
-
@tt[child.last, to] = nil
|
46
|
-
end
|
47
|
-
|
48
|
-
@tt.accepting = to
|
49
|
-
|
50
|
-
[from, to]
|
51
|
-
end
|
52
|
-
|
53
|
-
def terminal(node)
|
54
|
-
from_i = @i += 1 # new state
|
55
|
-
to_i = @i += 1 # new state
|
56
|
-
|
57
|
-
@tt[from_i, to_i] = node
|
58
|
-
@tt.accepting = to_i
|
59
|
-
@tt.add_memo(to_i, node.memo)
|
60
|
-
|
61
|
-
[from_i, to_i]
|
62
|
-
end
|
63
|
-
end
|
64
|
-
|
65
|
-
class Builder # :nodoc:
|
66
|
-
def initialize(ast)
|
67
|
-
@ast = ast
|
68
|
-
end
|
69
|
-
|
70
|
-
def transition_table
|
71
|
-
tt = TransitionTable.new
|
72
|
-
Visitor.new(tt).accept(@ast)
|
73
|
-
tt
|
74
|
-
end
|
75
|
-
end
|
76
|
-
end
|
77
|
-
end
|
78
|
-
end
|
@@ -1,47 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "strscan"
|
4
|
-
|
5
|
-
module ActionDispatch
|
6
|
-
module Journey # :nodoc:
|
7
|
-
module NFA # :nodoc:
|
8
|
-
class MatchData # :nodoc:
|
9
|
-
attr_reader :memos
|
10
|
-
|
11
|
-
def initialize(memos)
|
12
|
-
@memos = memos
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
class Simulator # :nodoc:
|
17
|
-
attr_reader :tt
|
18
|
-
|
19
|
-
def initialize(transition_table)
|
20
|
-
@tt = transition_table
|
21
|
-
end
|
22
|
-
|
23
|
-
def simulate(string)
|
24
|
-
input = StringScanner.new(string)
|
25
|
-
state = tt.eclosure(0)
|
26
|
-
until input.eos?
|
27
|
-
sym = input.scan(%r([/.?]|[^/.?]+))
|
28
|
-
state = tt.eclosure(tt.move(state, sym))
|
29
|
-
end
|
30
|
-
|
31
|
-
acceptance_states = state.find_all { |s|
|
32
|
-
tt.accepting?(tt.eclosure(s).sort.last)
|
33
|
-
}
|
34
|
-
|
35
|
-
return if acceptance_states.empty?
|
36
|
-
|
37
|
-
memos = acceptance_states.flat_map { |x| tt.memo(x) }.compact
|
38
|
-
|
39
|
-
MatchData.new(memos)
|
40
|
-
end
|
41
|
-
|
42
|
-
alias :=~ :simulate
|
43
|
-
alias :match :simulate
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|