actionpack 5.0.7.2 → 5.1.0.beta1
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 +5 -5
- data/CHANGELOG.md +189 -1002
- data/MIT-LICENSE +1 -1
- data/README.rdoc +1 -1
- data/lib/abstract_controller.rb +3 -3
- data/lib/abstract_controller/base.rb +10 -12
- data/lib/abstract_controller/caching.rb +6 -3
- data/lib/abstract_controller/caching/fragments.rb +1 -1
- data/lib/abstract_controller/callbacks.rb +2 -43
- data/lib/abstract_controller/collector.rb +2 -2
- data/lib/abstract_controller/helpers.rb +19 -19
- data/lib/abstract_controller/rendering.rb +9 -11
- data/lib/abstract_controller/translation.rb +3 -3
- data/lib/action_controller.rb +15 -13
- data/lib/action_controller/api.rb +3 -3
- data/lib/action_controller/base.rb +7 -12
- data/lib/action_controller/caching.rb +1 -1
- data/lib/action_controller/log_subscriber.rb +2 -2
- data/lib/action_controller/metal.rb +34 -43
- data/lib/action_controller/metal/conditional_get.rb +10 -9
- data/lib/action_controller/metal/data_streaming.rb +8 -9
- data/lib/action_controller/metal/etag_with_flash.rb +16 -0
- data/lib/action_controller/metal/etag_with_template_digest.rb +15 -15
- data/lib/action_controller/metal/exceptions.rb +4 -14
- data/lib/action_controller/metal/flash.rb +1 -1
- data/lib/action_controller/metal/force_ssl.rb +6 -6
- data/lib/action_controller/metal/head.rb +13 -19
- data/lib/action_controller/metal/helpers.rb +6 -6
- data/lib/action_controller/metal/http_authentication.rb +22 -23
- data/lib/action_controller/metal/implicit_render.rb +2 -5
- data/lib/action_controller/metal/instrumentation.rb +14 -14
- data/lib/action_controller/metal/live.rb +15 -16
- data/lib/action_controller/metal/mime_responds.rb +3 -3
- data/lib/action_controller/metal/parameter_encoding.rb +49 -0
- data/lib/action_controller/metal/params_wrapper.rb +32 -32
- data/lib/action_controller/metal/redirecting.rb +8 -24
- data/lib/action_controller/metal/renderers.rb +2 -3
- data/lib/action_controller/metal/rendering.rb +50 -60
- data/lib/action_controller/metal/request_forgery_protection.rb +51 -49
- data/lib/action_controller/metal/rescue.rb +1 -1
- data/lib/action_controller/metal/streaming.rb +4 -4
- data/lib/action_controller/metal/strong_parameters.rb +117 -250
- data/lib/action_controller/metal/testing.rb +1 -1
- data/lib/action_controller/metal/url_for.rb +4 -4
- data/lib/action_controller/railtie.rb +9 -13
- data/lib/action_controller/renderer.rb +17 -16
- data/lib/action_controller/test_case.rb +75 -148
- data/lib/action_dispatch.rb +20 -19
- data/lib/action_dispatch/http/cache.rb +9 -10
- data/lib/action_dispatch/http/filter_parameters.rb +8 -8
- data/lib/action_dispatch/http/filter_redirect.rb +2 -4
- data/lib/action_dispatch/http/headers.rb +10 -10
- data/lib/action_dispatch/http/mime_negotiation.rb +17 -22
- data/lib/action_dispatch/http/mime_type.rb +27 -52
- data/lib/action_dispatch/http/parameter_filter.rb +8 -6
- data/lib/action_dispatch/http/parameters.rb +40 -17
- data/lib/action_dispatch/http/request.rb +38 -34
- data/lib/action_dispatch/http/response.rb +16 -16
- data/lib/action_dispatch/http/upload.rb +6 -10
- data/lib/action_dispatch/http/url.rb +48 -74
- data/lib/action_dispatch/journey.rb +5 -5
- data/lib/action_dispatch/journey/formatter.rb +8 -4
- data/lib/action_dispatch/journey/gtg/builder.rb +5 -5
- data/lib/action_dispatch/journey/gtg/simulator.rb +1 -1
- data/lib/action_dispatch/journey/gtg/transition_table.rb +15 -15
- data/lib/action_dispatch/journey/nfa/builder.rb +3 -3
- data/lib/action_dispatch/journey/nfa/dot.rb +2 -2
- data/lib/action_dispatch/journey/nfa/simulator.rb +1 -1
- data/lib/action_dispatch/journey/nfa/transition_table.rb +2 -2
- data/lib/action_dispatch/journey/nodes/node.rb +5 -5
- data/lib/action_dispatch/journey/parser.rb +23 -24
- data/lib/action_dispatch/journey/parser.y +3 -2
- data/lib/action_dispatch/journey/parser_extras.rb +2 -2
- data/lib/action_dispatch/journey/path/pattern.rb +10 -3
- data/lib/action_dispatch/journey/route.rb +19 -12
- data/lib/action_dispatch/journey/router.rb +19 -12
- data/lib/action_dispatch/journey/router/utils.rb +9 -9
- data/lib/action_dispatch/journey/scanner.rb +17 -15
- data/lib/action_dispatch/journey/visitors.rb +23 -23
- data/lib/action_dispatch/middleware/callbacks.rb +0 -12
- data/lib/action_dispatch/middleware/cookies.rb +39 -39
- data/lib/action_dispatch/middleware/debug_exceptions.rb +126 -112
- data/lib/action_dispatch/middleware/debug_locks.rb +8 -8
- data/lib/action_dispatch/middleware/exception_wrapper.rb +55 -55
- data/lib/action_dispatch/middleware/executor.rb +1 -1
- data/lib/action_dispatch/middleware/flash.rb +17 -16
- data/lib/action_dispatch/middleware/public_exceptions.rb +20 -20
- data/lib/action_dispatch/middleware/reloader.rb +3 -47
- data/lib/action_dispatch/middleware/remote_ip.rb +6 -8
- data/lib/action_dispatch/middleware/request_id.rb +6 -5
- data/lib/action_dispatch/middleware/session/abstract_store.rb +14 -26
- data/lib/action_dispatch/middleware/session/cache_store.rb +3 -3
- data/lib/action_dispatch/middleware/session/cookie_store.rb +35 -35
- data/lib/action_dispatch/middleware/session/mem_cache_store.rb +2 -2
- data/lib/action_dispatch/middleware/show_exceptions.rb +19 -19
- data/lib/action_dispatch/middleware/ssl.rb +9 -27
- data/lib/action_dispatch/middleware/stack.rb +7 -26
- data/lib/action_dispatch/middleware/static.rb +13 -24
- data/lib/action_dispatch/railtie.rb +9 -11
- data/lib/action_dispatch/request/session.rb +22 -22
- data/lib/action_dispatch/request/utils.rb +11 -2
- data/lib/action_dispatch/routing.rb +8 -6
- data/lib/action_dispatch/routing/inspector.rb +37 -37
- data/lib/action_dispatch/routing/mapper.rb +296 -203
- data/lib/action_dispatch/routing/polymorphic_routes.rb +160 -134
- data/lib/action_dispatch/routing/redirection.rb +27 -22
- data/lib/action_dispatch/routing/route_set.rb +206 -92
- data/lib/action_dispatch/routing/routes_proxy.rb +2 -2
- data/lib/action_dispatch/routing/url_for.rb +14 -12
- data/lib/action_dispatch/system_test_case.rb +119 -0
- data/lib/action_dispatch/system_testing/browser.rb +28 -0
- data/lib/action_dispatch/system_testing/driver.rb +18 -0
- data/lib/action_dispatch/system_testing/server.rb +32 -0
- data/lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb +61 -0
- data/lib/action_dispatch/system_testing/test_helpers/setup_and_teardown.rb +20 -0
- data/lib/action_dispatch/testing/assertion_response.rb +6 -6
- data/lib/action_dispatch/testing/assertions.rb +4 -4
- data/lib/action_dispatch/testing/assertions/response.rb +8 -3
- data/lib/action_dispatch/testing/assertions/routing.rb +11 -11
- data/lib/action_dispatch/testing/integration.rb +47 -138
- data/lib/action_dispatch/testing/test_process.rb +2 -2
- data/lib/action_dispatch/testing/test_request.rb +16 -16
- data/lib/action_dispatch/testing/test_response.rb +1 -1
- data/lib/action_pack.rb +2 -2
- data/lib/action_pack/gem_version.rb +3 -3
- data/lib/action_pack/version.rb +1 -1
- metadata +20 -12
- data/lib/action_dispatch/middleware/params_parser.rb +0 -46
@@ -1,69 +1,50 @@
|
|
1
|
-
require
|
2
|
-
require
|
3
|
-
require
|
4
|
-
require
|
5
|
-
require
|
6
|
-
require
|
7
|
-
require 'minitest'
|
1
|
+
require "stringio"
|
2
|
+
require "uri"
|
3
|
+
require "active_support/core_ext/kernel/singleton_class"
|
4
|
+
require "active_support/core_ext/object/try"
|
5
|
+
require "rack/test"
|
6
|
+
require "minitest"
|
8
7
|
|
9
|
-
require
|
8
|
+
require "action_dispatch/testing/request_encoder"
|
10
9
|
|
11
10
|
module ActionDispatch
|
12
11
|
module Integration #:nodoc:
|
13
12
|
module RequestHelpers
|
14
|
-
|
15
|
-
|
13
|
+
# Performs a GET request with the given parameters. See +#process+ for more
|
14
|
+
# details.
|
15
|
+
def get(path, **args)
|
16
|
+
process(:get, path, **args)
|
16
17
|
end
|
17
18
|
|
18
19
|
# Performs a POST request with the given parameters. See +#process+ for more
|
19
20
|
# details.
|
20
|
-
def post(path,
|
21
|
-
|
21
|
+
def post(path, **args)
|
22
|
+
process(:post, path, **args)
|
22
23
|
end
|
23
24
|
|
24
25
|
# Performs a PATCH request with the given parameters. See +#process+ for more
|
25
26
|
# details.
|
26
|
-
def patch(path,
|
27
|
-
|
27
|
+
def patch(path, **args)
|
28
|
+
process(:patch, path, **args)
|
28
29
|
end
|
29
30
|
|
30
31
|
# Performs a PUT request with the given parameters. See +#process+ for more
|
31
32
|
# details.
|
32
|
-
def put(path,
|
33
|
-
|
33
|
+
def put(path, **args)
|
34
|
+
process(:put, path, **args)
|
34
35
|
end
|
35
36
|
|
36
37
|
# Performs a DELETE request with the given parameters. See +#process+ for
|
37
38
|
# more details.
|
38
|
-
def delete(path,
|
39
|
-
|
39
|
+
def delete(path, **args)
|
40
|
+
process(:delete, path, **args)
|
40
41
|
end
|
41
42
|
|
42
43
|
# Performs a HEAD request with the given parameters. See +#process+ for more
|
43
44
|
# details.
|
44
45
|
def head(path, *args)
|
45
|
-
|
46
|
-
end
|
47
|
-
|
48
|
-
# Performs an XMLHttpRequest request with the given parameters, mirroring
|
49
|
-
# an AJAX request made from JavaScript.
|
50
|
-
#
|
51
|
-
# The request_method is +:get+, +:post+, +:patch+, +:put+, +:delete+ or
|
52
|
-
# +:head+; the parameters are +nil+, a hash, or a url-encoded or multipart
|
53
|
-
# string; the headers are a hash.
|
54
|
-
#
|
55
|
-
# Example:
|
56
|
-
#
|
57
|
-
# xhr :get, '/feed', since: 201501011400
|
58
|
-
def xml_http_request(request_method, path, parameters = nil, headers_or_env = nil)
|
59
|
-
ActiveSupport::Deprecation.warn(<<-MSG.strip_heredoc)
|
60
|
-
`xhr` and `xml_http_request` are deprecated and will be removed in Rails 5.1.
|
61
|
-
Switch to e.g. `post comments_path, params: { comment: { body: 'Honey bunny' } }, xhr: true`.
|
62
|
-
MSG
|
63
|
-
|
64
|
-
process(request_method, path, params: parameters, headers: headers_or_env, xhr: true)
|
46
|
+
process(:head, path, *args)
|
65
47
|
end
|
66
|
-
alias xhr :xml_http_request
|
67
48
|
|
68
49
|
# Follow a single redirect response. If the last response was not a
|
69
50
|
# redirect, an exception will be raised. Otherwise, the redirect is
|
@@ -73,59 +54,6 @@ module ActionDispatch
|
|
73
54
|
get(response.location)
|
74
55
|
status
|
75
56
|
end
|
76
|
-
|
77
|
-
# Performs a request using the specified method, following any subsequent
|
78
|
-
# redirect. Note that the redirects are followed until the response is
|
79
|
-
# not a redirect--this means you may run into an infinite loop if your
|
80
|
-
# redirect loops back to itself.
|
81
|
-
#
|
82
|
-
# Example:
|
83
|
-
#
|
84
|
-
# request_via_redirect :post, '/welcome',
|
85
|
-
# params: { ref_id: 14 },
|
86
|
-
# headers: { "X-Test-Header" => "testvalue" }
|
87
|
-
def request_via_redirect(http_method, path, *args)
|
88
|
-
ActiveSupport::Deprecation.warn('`request_via_redirect` is deprecated and will be removed in Rails 5.1. Please use `follow_redirect!` manually after the request call for the same behavior.')
|
89
|
-
process_with_kwargs(http_method, path, *args)
|
90
|
-
|
91
|
-
follow_redirect! while redirect?
|
92
|
-
status
|
93
|
-
end
|
94
|
-
|
95
|
-
# Performs a GET request, following any subsequent redirect.
|
96
|
-
# See +request_via_redirect+ for more information.
|
97
|
-
def get_via_redirect(path, *args)
|
98
|
-
ActiveSupport::Deprecation.warn('`get_via_redirect` is deprecated and will be removed in Rails 5.1. Please use `follow_redirect!` manually after the request call for the same behavior.')
|
99
|
-
request_via_redirect(:get, path, *args)
|
100
|
-
end
|
101
|
-
|
102
|
-
# Performs a POST request, following any subsequent redirect.
|
103
|
-
# See +request_via_redirect+ for more information.
|
104
|
-
def post_via_redirect(path, *args)
|
105
|
-
ActiveSupport::Deprecation.warn('`post_via_redirect` is deprecated and will be removed in Rails 5.1. Please use `follow_redirect!` manually after the request call for the same behavior.')
|
106
|
-
request_via_redirect(:post, path, *args)
|
107
|
-
end
|
108
|
-
|
109
|
-
# Performs a PATCH request, following any subsequent redirect.
|
110
|
-
# See +request_via_redirect+ for more information.
|
111
|
-
def patch_via_redirect(path, *args)
|
112
|
-
ActiveSupport::Deprecation.warn('`patch_via_redirect` is deprecated and will be removed in Rails 5.1. Please use `follow_redirect!` manually after the request call for the same behavior.')
|
113
|
-
request_via_redirect(:patch, path, *args)
|
114
|
-
end
|
115
|
-
|
116
|
-
# Performs a PUT request, following any subsequent redirect.
|
117
|
-
# See +request_via_redirect+ for more information.
|
118
|
-
def put_via_redirect(path, *args)
|
119
|
-
ActiveSupport::Deprecation.warn('`put_via_redirect` is deprecated and will be removed in Rails 5.1. Please use `follow_redirect!` manually after the request call for the same behavior.')
|
120
|
-
request_via_redirect(:put, path, *args)
|
121
|
-
end
|
122
|
-
|
123
|
-
# Performs a DELETE request, following any subsequent redirect.
|
124
|
-
# See +request_via_redirect+ for more information.
|
125
|
-
def delete_via_redirect(path, *args)
|
126
|
-
ActiveSupport::Deprecation.warn('`delete_via_redirect` is deprecated and will be removed in Rails 5.1. Please use `follow_redirect!` manually after the request call for the same behavior.')
|
127
|
-
request_via_redirect(:delete, path, *args)
|
128
|
-
end
|
129
57
|
end
|
130
58
|
|
131
59
|
# An instance of this class represents a set of requests and responses
|
@@ -143,11 +71,11 @@ module ActionDispatch
|
|
143
71
|
include TestProcess, RequestHelpers, Assertions
|
144
72
|
|
145
73
|
%w( status status_message headers body redirect? ).each do |method|
|
146
|
-
delegate method, :
|
74
|
+
delegate method, to: :response, allow_nil: true
|
147
75
|
end
|
148
76
|
|
149
77
|
%w( path ).each do |method|
|
150
|
-
delegate method, :
|
78
|
+
delegate method, to: :request, allow_nil: true
|
151
79
|
end
|
152
80
|
|
153
81
|
# The hostname used in the last request.
|
@@ -198,7 +126,7 @@ module ActionDispatch
|
|
198
126
|
url_options.reverse_merge!(@app.routes.default_url_options)
|
199
127
|
end
|
200
128
|
|
201
|
-
url_options.reverse_merge!(:
|
129
|
+
url_options.reverse_merge!(host: host, protocol: https? ? "https" : "http")
|
202
130
|
end
|
203
131
|
end
|
204
132
|
|
@@ -216,8 +144,8 @@ module ActionDispatch
|
|
216
144
|
|
217
145
|
self.host = DEFAULT_HOST
|
218
146
|
self.remote_addr = "127.0.0.1"
|
219
|
-
self.accept = "text/xml,application/xml,application/xhtml+xml,"
|
220
|
-
"text/html;q=0.9,text/plain;q=0.8,image/png,"
|
147
|
+
self.accept = "text/xml,application/xml,application/xhtml+xml," \
|
148
|
+
"text/html;q=0.9,text/plain;q=0.8,image/png," \
|
221
149
|
"*/*;q=0.5"
|
222
150
|
|
223
151
|
unless defined? @named_routes_configured
|
@@ -262,7 +190,7 @@ module ActionDispatch
|
|
262
190
|
#
|
263
191
|
# This method is rarely used directly. Use +#get+, +#post+, or other standard
|
264
192
|
# HTTP methods in integration tests. +#process+ is only required when using a
|
265
|
-
# request method that doesn't have a method defined in the
|
193
|
+
# request method that doesn't have a method defined in the integration tests.
|
266
194
|
#
|
267
195
|
# This method returns a Response object, which one can use to
|
268
196
|
# inspect the details of the response. Furthermore, if this method was
|
@@ -271,29 +199,29 @@ module ActionDispatch
|
|
271
199
|
# response object.
|
272
200
|
#
|
273
201
|
# Example:
|
274
|
-
#
|
275
202
|
# process :get, '/author', params: { since: 201501011400 }
|
276
203
|
def process(method, path, params: nil, headers: nil, env: nil, xhr: false, as: nil)
|
277
204
|
request_encoder = RequestEncoder.encoder(as)
|
278
205
|
headers ||= {}
|
279
206
|
|
280
207
|
if method == :get && as == :json && params
|
281
|
-
headers[
|
208
|
+
headers["X-Http-Method-Override"] = "GET"
|
282
209
|
method = :post
|
283
210
|
end
|
284
211
|
|
285
212
|
if path =~ %r{://}
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
213
|
+
path = build_expanded_path(path) do |location|
|
214
|
+
https! URI::HTTPS === location if location.scheme
|
215
|
+
|
216
|
+
if url_host = location.host
|
217
|
+
default = Rack::Request::DEFAULT_PORTS[location.scheme]
|
218
|
+
url_host += ":#{location.port}" if default != location.port
|
219
|
+
host! url_host
|
220
|
+
end
|
292
221
|
end
|
293
|
-
path = location.query ? "#{location.path}?#{location.query}" : location.path
|
294
222
|
end
|
295
223
|
|
296
|
-
hostname, port = host.split(
|
224
|
+
hostname, port = host.split(":")
|
297
225
|
|
298
226
|
request_env = {
|
299
227
|
:method => method,
|
@@ -356,36 +284,16 @@ module ActionDispatch
|
|
356
284
|
@_mock_session ||= Rack::MockSession.new(@app, host)
|
357
285
|
end
|
358
286
|
|
359
|
-
def process_with_kwargs(http_method, path, *args)
|
360
|
-
if kwarg_request?(args)
|
361
|
-
process(http_method, path, *args)
|
362
|
-
else
|
363
|
-
non_kwarg_request_warning if args.any?
|
364
|
-
process(http_method, path, { params: args[0], headers: args[1] })
|
365
|
-
end
|
366
|
-
end
|
367
|
-
|
368
|
-
REQUEST_KWARGS = %i(params headers env xhr as)
|
369
|
-
def kwarg_request?(args)
|
370
|
-
args[0].respond_to?(:keys) && args[0].keys.any? { |k| REQUEST_KWARGS.include?(k) }
|
371
|
-
end
|
372
|
-
|
373
|
-
def non_kwarg_request_warning
|
374
|
-
ActiveSupport::Deprecation.warn(<<-MSG.strip_heredoc)
|
375
|
-
Using positional arguments in integration tests has been deprecated,
|
376
|
-
in favor of keyword arguments, and will be removed in Rails 5.1.
|
377
|
-
|
378
|
-
Deprecated style:
|
379
|
-
get "/profile", { id: 1 }, { "X-Extra-Header" => "123" }
|
380
|
-
|
381
|
-
New keyword style:
|
382
|
-
get "/profile", params: { id: 1 }, headers: { "X-Extra-Header" => "123" }
|
383
|
-
MSG
|
384
|
-
end
|
385
|
-
|
386
287
|
def build_full_uri(path, env)
|
387
288
|
"#{env['rack.url_scheme']}://#{env['SERVER_NAME']}:#{env['SERVER_PORT']}#{path}"
|
388
289
|
end
|
290
|
+
|
291
|
+
def build_expanded_path(path)
|
292
|
+
location = URI.parse(path)
|
293
|
+
yield location if block_given?
|
294
|
+
path = location.path
|
295
|
+
location.query ? "#{path}?#{location.query}" : path
|
296
|
+
end
|
389
297
|
end
|
390
298
|
|
391
299
|
module Runner
|
@@ -432,10 +340,10 @@ module ActionDispatch
|
|
432
340
|
end
|
433
341
|
|
434
342
|
%w(get post patch put head delete cookies assigns
|
435
|
-
xml_http_request xhr get_via_redirect post_via_redirect
|
343
|
+
xml_http_request xhr get_via_redirect post_via_redirect).each do |method|
|
436
344
|
define_method(method) do |*args|
|
437
345
|
# reset the html_document variable, except for cookies/assigns calls
|
438
|
-
unless method ==
|
346
|
+
unless method == "cookies" || method == "assigns"
|
439
347
|
@html_document = nil
|
440
348
|
end
|
441
349
|
|
@@ -457,6 +365,7 @@ module ActionDispatch
|
|
457
365
|
# simultaneously.
|
458
366
|
def open_session
|
459
367
|
dup.tap do |session|
|
368
|
+
session.reset!
|
460
369
|
yield session if block_given?
|
461
370
|
end
|
462
371
|
end
|
@@ -477,7 +386,7 @@ module ActionDispatch
|
|
477
386
|
integration_session.default_url_options = options
|
478
387
|
end
|
479
388
|
|
480
|
-
def
|
389
|
+
def respond_to_missing?(method, include_private = false)
|
481
390
|
integration_session.respond_to?(method, include_private) || super
|
482
391
|
end
|
483
392
|
|
@@ -1,12 +1,12 @@
|
|
1
|
-
require
|
2
|
-
require
|
1
|
+
require "active_support/core_ext/hash/indifferent_access"
|
2
|
+
require "rack/utils"
|
3
3
|
|
4
4
|
module ActionDispatch
|
5
5
|
class TestRequest < Request
|
6
|
-
DEFAULT_ENV = Rack::MockRequest.env_for(
|
7
|
-
|
8
|
-
|
9
|
-
|
6
|
+
DEFAULT_ENV = Rack::MockRequest.env_for("/",
|
7
|
+
"HTTP_HOST" => "test.host",
|
8
|
+
"REMOTE_ADDR" => "0.0.0.0",
|
9
|
+
"HTTP_USER_AGENT" => "Rails Testing",
|
10
10
|
)
|
11
11
|
|
12
12
|
# Create a new test request with default `env` values
|
@@ -26,19 +26,19 @@ module ActionDispatch
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def host=(host)
|
29
|
-
set_header(
|
29
|
+
set_header("HTTP_HOST", host)
|
30
30
|
end
|
31
31
|
|
32
32
|
def port=(number)
|
33
|
-
set_header(
|
33
|
+
set_header("SERVER_PORT", number.to_i)
|
34
34
|
end
|
35
35
|
|
36
36
|
def request_uri=(uri)
|
37
|
-
set_header(
|
37
|
+
set_header("REQUEST_URI", uri)
|
38
38
|
end
|
39
39
|
|
40
40
|
def path=(path)
|
41
|
-
set_header(
|
41
|
+
set_header("PATH_INFO", path)
|
42
42
|
end
|
43
43
|
|
44
44
|
def action=(action_name)
|
@@ -46,24 +46,24 @@ module ActionDispatch
|
|
46
46
|
end
|
47
47
|
|
48
48
|
def if_modified_since=(last_modified)
|
49
|
-
set_header(
|
49
|
+
set_header("HTTP_IF_MODIFIED_SINCE", last_modified)
|
50
50
|
end
|
51
51
|
|
52
52
|
def if_none_match=(etag)
|
53
|
-
set_header(
|
53
|
+
set_header("HTTP_IF_NONE_MATCH", etag)
|
54
54
|
end
|
55
55
|
|
56
56
|
def remote_addr=(addr)
|
57
|
-
set_header(
|
57
|
+
set_header("REMOTE_ADDR", addr)
|
58
58
|
end
|
59
59
|
|
60
60
|
def user_agent=(user_agent)
|
61
|
-
set_header(
|
61
|
+
set_header("HTTP_USER_AGENT", user_agent)
|
62
62
|
end
|
63
63
|
|
64
64
|
def accept=(mime_types)
|
65
|
-
delete_header(
|
66
|
-
set_header(
|
65
|
+
delete_header("action_dispatch.request.accepts")
|
66
|
+
set_header("HTTP_ACCEPT", Array(mime_types).collect(&:to_s).join(","))
|
67
67
|
end
|
68
68
|
end
|
69
69
|
end
|
data/lib/action_pack.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
#--
|
2
|
-
# Copyright (c) 2004-
|
2
|
+
# Copyright (c) 2004-2017 David Heinemeier Hansson
|
3
3
|
#
|
4
4
|
# Permission is hereby granted, free of charge, to any person obtaining
|
5
5
|
# a copy of this software and associated documentation files (the
|
@@ -21,4 +21,4 @@
|
|
21
21
|
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
22
22
|
#++
|
23
23
|
|
24
|
-
require
|
24
|
+
require "action_pack/version"
|
data/lib/action_pack/version.rb
CHANGED
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: 5.0.
|
4
|
+
version: 5.1.0.beta1
|
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:
|
11
|
+
date: 2017-02-23 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: 5.0.
|
19
|
+
version: 5.1.0.beta1
|
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: 5.0.
|
26
|
+
version: 5.1.0.beta1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rack
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -92,28 +92,28 @@ dependencies:
|
|
92
92
|
requirements:
|
93
93
|
- - '='
|
94
94
|
- !ruby/object:Gem::Version
|
95
|
-
version: 5.0.
|
95
|
+
version: 5.1.0.beta1
|
96
96
|
type: :runtime
|
97
97
|
prerelease: false
|
98
98
|
version_requirements: !ruby/object:Gem::Requirement
|
99
99
|
requirements:
|
100
100
|
- - '='
|
101
101
|
- !ruby/object:Gem::Version
|
102
|
-
version: 5.0.
|
102
|
+
version: 5.1.0.beta1
|
103
103
|
- !ruby/object:Gem::Dependency
|
104
104
|
name: activemodel
|
105
105
|
requirement: !ruby/object:Gem::Requirement
|
106
106
|
requirements:
|
107
107
|
- - '='
|
108
108
|
- !ruby/object:Gem::Version
|
109
|
-
version: 5.0.
|
109
|
+
version: 5.1.0.beta1
|
110
110
|
type: :development
|
111
111
|
prerelease: false
|
112
112
|
version_requirements: !ruby/object:Gem::Requirement
|
113
113
|
requirements:
|
114
114
|
- - '='
|
115
115
|
- !ruby/object:Gem::Version
|
116
|
-
version: 5.0.
|
116
|
+
version: 5.1.0.beta1
|
117
117
|
description: Web apps on Rails. Simple, battle-tested conventions for building and
|
118
118
|
testing MVC web applications. Works with any Rack-compatible server.
|
119
119
|
email: david@loudthinking.com
|
@@ -150,6 +150,7 @@ files:
|
|
150
150
|
- lib/action_controller/metal/conditional_get.rb
|
151
151
|
- lib/action_controller/metal/cookies.rb
|
152
152
|
- lib/action_controller/metal/data_streaming.rb
|
153
|
+
- lib/action_controller/metal/etag_with_flash.rb
|
153
154
|
- lib/action_controller/metal/etag_with_template_digest.rb
|
154
155
|
- lib/action_controller/metal/exceptions.rb
|
155
156
|
- lib/action_controller/metal/flash.rb
|
@@ -161,6 +162,7 @@ files:
|
|
161
162
|
- lib/action_controller/metal/instrumentation.rb
|
162
163
|
- lib/action_controller/metal/live.rb
|
163
164
|
- lib/action_controller/metal/mime_responds.rb
|
165
|
+
- lib/action_controller/metal/parameter_encoding.rb
|
164
166
|
- lib/action_controller/metal/params_wrapper.rb
|
165
167
|
- lib/action_controller/metal/redirecting.rb
|
166
168
|
- lib/action_controller/metal/renderers.rb
|
@@ -221,7 +223,6 @@ files:
|
|
221
223
|
- lib/action_dispatch/middleware/exception_wrapper.rb
|
222
224
|
- lib/action_dispatch/middleware/executor.rb
|
223
225
|
- lib/action_dispatch/middleware/flash.rb
|
224
|
-
- lib/action_dispatch/middleware/params_parser.rb
|
225
226
|
- lib/action_dispatch/middleware/public_exceptions.rb
|
226
227
|
- lib/action_dispatch/middleware/reloader.rb
|
227
228
|
- lib/action_dispatch/middleware/remote_ip.rb
|
@@ -265,6 +266,12 @@ files:
|
|
265
266
|
- lib/action_dispatch/routing/route_set.rb
|
266
267
|
- lib/action_dispatch/routing/routes_proxy.rb
|
267
268
|
- lib/action_dispatch/routing/url_for.rb
|
269
|
+
- lib/action_dispatch/system_test_case.rb
|
270
|
+
- lib/action_dispatch/system_testing/browser.rb
|
271
|
+
- lib/action_dispatch/system_testing/driver.rb
|
272
|
+
- lib/action_dispatch/system_testing/server.rb
|
273
|
+
- lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb
|
274
|
+
- lib/action_dispatch/system_testing/test_helpers/setup_and_teardown.rb
|
268
275
|
- lib/action_dispatch/testing/assertion_response.rb
|
269
276
|
- lib/action_dispatch/testing/assertions.rb
|
270
277
|
- lib/action_dispatch/testing/assertions/response.rb
|
@@ -292,12 +299,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
292
299
|
version: 2.2.2
|
293
300
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
294
301
|
requirements:
|
295
|
-
- - "
|
302
|
+
- - ">"
|
296
303
|
- !ruby/object:Gem::Version
|
297
|
-
version:
|
304
|
+
version: 1.3.1
|
298
305
|
requirements:
|
299
306
|
- none
|
300
|
-
|
307
|
+
rubyforge_project:
|
308
|
+
rubygems_version: 2.6.10
|
301
309
|
signing_key:
|
302
310
|
specification_version: 4
|
303
311
|
summary: Web-flow and rendering framework putting the VC in MVC (part of Rails).
|