roda 3.82.0 → 3.83.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG +4 -0
- data/doc/release_notes/3.83.0.txt +6 -0
- data/lib/roda/plugins/assume_ssl.rb +28 -0
- data/lib/roda/plugins/multi_public.rb +3 -3
- data/lib/roda/plugins/public.rb +1 -1
- data/lib/roda/plugins/timestamp_public.rb +1 -1
- data/lib/roda/plugins/typecast_params.rb +1 -1
- data/lib/roda/version.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8f3ad50e6de6bdfa7e2019cbcbe4a07b920a23adb30645616340b8bc007951a1
|
|
4
|
+
data.tar.gz: b5bd2835bb0f5286fb92555c602949482c4730b3497de4506a841a6ab3e80718
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8e6937b542ae838a0b4e79171936fc3cd937faf127900b34265ff9e0923144bf5cf25879fe0103b43b51fb9c940e1dfc6c058f91eb02bab23177369e3b0424f7
|
|
7
|
+
data.tar.gz: d7515ac6becbb47900713e5349b52eb41e284391c5a75743b4e3adcb3609a8ad09a20b8e38e7d85ddb59c52681396a9ec2b1b82b3264752731837b873907835d
|
data/CHANGELOG
CHANGED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
= New Features
|
|
2
|
+
|
|
3
|
+
* An assume_ssl plugin has been added. This plugin is designed for
|
|
4
|
+
cases where the application is being fronted by an SSL-terminating
|
|
5
|
+
reverse proxy that does not set the X-Forwarded-Proto or similar
|
|
6
|
+
header to indicate it is forwarding an SSL request.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# frozen-string-literal: true
|
|
2
|
+
|
|
3
|
+
#
|
|
4
|
+
class Roda
|
|
5
|
+
module RodaPlugins
|
|
6
|
+
# The assume_ssl plugin makes the request ssl? method always return
|
|
7
|
+
# true. This is useful when using an SSL-terminating reverse proxy
|
|
8
|
+
# that doesn't set the X-Forwarded-Proto or similar header to notify
|
|
9
|
+
# Rack that it is forwarding an SSL request.
|
|
10
|
+
#
|
|
11
|
+
# The sessions and sinatra_helpers plugins that ship with Roda both
|
|
12
|
+
# use the ssl? method internally and can be affected by use of the
|
|
13
|
+
# plugin. It's recommended that you use this plugin if you are
|
|
14
|
+
# using either plugin and an SSL-terminating proxy as described above.
|
|
15
|
+
#
|
|
16
|
+
# plugin :assume_ssl
|
|
17
|
+
module AssumeSSL
|
|
18
|
+
module RequestMethods
|
|
19
|
+
# Assume all requests are protected by SSL.
|
|
20
|
+
def ssl?
|
|
21
|
+
true
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
register_plugin(:assume_ssl, AssumeSSL)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -21,7 +21,7 @@ class Roda
|
|
|
21
21
|
# font: 'assets/fonts',
|
|
22
22
|
# form: 'static/forms/pdfs'
|
|
23
23
|
#
|
|
24
|
-
#
|
|
24
|
+
# route do
|
|
25
25
|
# r.on "images" do
|
|
26
26
|
# r.multi_public(:img)
|
|
27
27
|
# end
|
|
@@ -43,7 +43,7 @@ class Roda
|
|
|
43
43
|
# 'fonts' => 'assets/fonts',
|
|
44
44
|
# 'forms' => 'static/forms/pdfs'
|
|
45
45
|
#
|
|
46
|
-
#
|
|
46
|
+
# route do
|
|
47
47
|
# r.on %w"images fonts forms" do |dir|
|
|
48
48
|
# r.multi_public(dir)
|
|
49
49
|
# end
|
|
@@ -58,7 +58,7 @@ class Roda
|
|
|
58
58
|
# 'fonts' => ['assets/fonts', {'Cache-Control'=>'max-age=31536000'}, 'font/ttf'],
|
|
59
59
|
# 'forms' => ['static/forms/pdfs', nil, 'application/pdf']
|
|
60
60
|
#
|
|
61
|
-
#
|
|
61
|
+
# route do
|
|
62
62
|
# r.on %w"images fonts forms" do |dir|
|
|
63
63
|
# r.multi_public(dir)
|
|
64
64
|
# end
|
data/lib/roda/plugins/public.rb
CHANGED
|
@@ -25,7 +25,7 @@ class Roda
|
|
|
25
25
|
# plugin :public, root: 'static', prefix: 'public'
|
|
26
26
|
#
|
|
27
27
|
# # Assuming public is the location of files, and static is the path prefix
|
|
28
|
-
#
|
|
28
|
+
# route do
|
|
29
29
|
# # Make GET /static/1238099123/images/foo.png look for public/images/foo.png
|
|
30
30
|
# r.timestamp_public
|
|
31
31
|
#
|
|
@@ -735,7 +735,7 @@ class Roda
|
|
|
735
735
|
# You can use +dig+ to get access to nested arrays by using <tt>:array</tt> or <tt>:array!</tt> as
|
|
736
736
|
# the first argument and providing the type in the second argument:
|
|
737
737
|
#
|
|
738
|
-
# tp.dig(:array, :pos_int, 'foo', 'bar', 'baz') # tp['foo']['bar'].array(:
|
|
738
|
+
# tp.dig(:array, :pos_int, 'foo', 'bar', 'baz') # tp['foo']['bar'].array(:pos_int, 'baz')
|
|
739
739
|
def dig(type, *nest, key)
|
|
740
740
|
_dig(false, type, nest, key)
|
|
741
741
|
end
|
data/lib/roda/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: roda
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.
|
|
4
|
+
version: 3.83.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jeremy Evans
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2024-
|
|
11
|
+
date: 2024-08-12 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rack
|
|
@@ -243,6 +243,7 @@ extra_rdoc_files:
|
|
|
243
243
|
- doc/release_notes/3.80.0.txt
|
|
244
244
|
- doc/release_notes/3.81.0.txt
|
|
245
245
|
- doc/release_notes/3.82.0.txt
|
|
246
|
+
- doc/release_notes/3.83.0.txt
|
|
246
247
|
- doc/release_notes/3.9.0.txt
|
|
247
248
|
files:
|
|
248
249
|
- CHANGELOG
|
|
@@ -332,6 +333,7 @@ files:
|
|
|
332
333
|
- doc/release_notes/3.80.0.txt
|
|
333
334
|
- doc/release_notes/3.81.0.txt
|
|
334
335
|
- doc/release_notes/3.82.0.txt
|
|
336
|
+
- doc/release_notes/3.83.0.txt
|
|
335
337
|
- doc/release_notes/3.9.0.txt
|
|
336
338
|
- lib/roda.rb
|
|
337
339
|
- lib/roda/cache.rb
|
|
@@ -347,6 +349,7 @@ files:
|
|
|
347
349
|
- lib/roda/plugins/all_verbs.rb
|
|
348
350
|
- lib/roda/plugins/assets.rb
|
|
349
351
|
- lib/roda/plugins/assets_preloading.rb
|
|
352
|
+
- lib/roda/plugins/assume_ssl.rb
|
|
350
353
|
- lib/roda/plugins/autoload_hash_branches.rb
|
|
351
354
|
- lib/roda/plugins/autoload_named_routes.rb
|
|
352
355
|
- lib/roda/plugins/backtracking_array.rb
|