sinatra 3.0.4 → 3.0.6
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of sinatra might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +20 -0
- data/CONTRIBUTING.md +11 -11
- data/Gemfile +3 -3
- data/MAINTENANCE.md +2 -2
- data/README.md +13 -14
- data/Rakefile +8 -17
- data/VERSION +1 -1
- data/examples/chat.rb +20 -9
- data/lib/sinatra/base.rb +27 -11
- data/lib/sinatra/version.rb +1 -1
- data/sinatra.gemspec +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '08567da318760f376b1c6c8ccafd4e1268ff19a800c90939d9f1448a7c85edcb'
|
4
|
+
data.tar.gz: 4287d74952e33c257cd981ed731e732cd0811dbeaeeb7fa553817ef3ad44a9d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af4979f21e7a5bc8e2aebadc68138ad5885829d5c25060303c526fec354552d178d39ae050f5a49700da4bc4b4653264e5371c6dfda44df585a7f198353f65dc
|
7
|
+
data.tar.gz: 3cd222fd4e5a5337cc63a6df8d813ec695cb2e4ea73294048de169e92c93dcee36a6d90f2bbb0a3525f3d27b86c3499f762f1c0b8904e79c7a012a9852095aeb
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,20 @@
|
|
2
2
|
|
3
3
|
* _Your new feature here._
|
4
4
|
|
5
|
+
## 3.0.6 / 2023-04-11
|
6
|
+
|
7
|
+
* Fix: Add support to keep open streaming connections with Puma [#1858](https://github.com/sinatra/sinatra/pull/1858) by Jordan Owens
|
8
|
+
|
9
|
+
* Fix: Avoid crash in `uri` helper on Integer input [#1890](https://github.com/sinatra/sinatra/pull/1890) by Patrik Ragnarsson
|
10
|
+
|
11
|
+
* Fix: Rescue `RuntimeError` when trying to use `SecureRandom` [#1888](https://github.com/sinatra/sinatra/pull/1888) by Stefan Sundin
|
12
|
+
|
13
|
+
## 3.0.5 / 2022-12-16
|
14
|
+
|
15
|
+
* Fix: Add Zeitwerk compatibility. [#1831](https://github.com/sinatra/sinatra/pull/1831) by Dawid Janczak
|
16
|
+
|
17
|
+
* Fix: Allow CALLERS_TO_IGNORE to be overridden
|
18
|
+
|
5
19
|
## 3.0.4 / 2022-11-25
|
6
20
|
|
7
21
|
* Fix: Escape filename in the Content-Disposition header. [#1841](https://github.com/sinatra/sinatra/pull/1841) by Kunpei Sakai
|
@@ -66,6 +80,12 @@
|
|
66
80
|
|
67
81
|
* Docs: Japanese documentation: Make Session section reflect changes done to README.md. [#1731](https://github.com/sinatra/sinatra/pull/1731) by @shu-i-chi
|
68
82
|
|
83
|
+
## 2.2.3 / 2022-11-25
|
84
|
+
|
85
|
+
* Fix: Escape filename in the Content-Disposition header. [#1841](https://github.com/sinatra/sinatra/pull/1841) by Kunpei Sakai
|
86
|
+
|
87
|
+
* Fix: fixed ReDoS for Rack::Protection::IPSpoofing. [#1823](https://github.com/sinatra/sinatra/pull/1823) by @ooooooo-q
|
88
|
+
|
69
89
|
## 2.2.2 / 2022-07-23
|
70
90
|
|
71
91
|
* Update mustermann dependency to version 2.
|
data/CONTRIBUTING.md
CHANGED
@@ -65,21 +65,21 @@ track patch requests.
|
|
65
65
|
also has its own [Git repository](http://github.com/sinatra/sinatra-recipes).
|
66
66
|
|
67
67
|
* [The Introduction](http://www.sinatrarb.com/intro.html) is generated from
|
68
|
-
Sinatra's [README file](http://github.com/sinatra/sinatra/blob/
|
68
|
+
Sinatra's [README file](http://github.com/sinatra/sinatra/blob/main/README.md).
|
69
69
|
|
70
70
|
* If you want to help translating the documentation, the README is already
|
71
71
|
available in
|
72
|
-
[Japanese](http://github.com/sinatra/sinatra/blob/
|
73
|
-
[German](http://github.com/sinatra/sinatra/blob/
|
74
|
-
[Chinese](https://github.com/sinatra/sinatra/blob/
|
75
|
-
[Russian](https://github.com/sinatra/sinatra/blob/
|
76
|
-
[European](https://github.com/sinatra/sinatra/blob/
|
77
|
-
[Brazilian](https://github.com/sinatra/sinatra/blob/
|
72
|
+
[Japanese](http://github.com/sinatra/sinatra/blob/main/README.ja.md),
|
73
|
+
[German](http://github.com/sinatra/sinatra/blob/main/README.de.md),
|
74
|
+
[Chinese](https://github.com/sinatra/sinatra/blob/main/README.zh.md),
|
75
|
+
[Russian](https://github.com/sinatra/sinatra/blob/main/README.ru.md),
|
76
|
+
[European](https://github.com/sinatra/sinatra/blob/main/README.pt-pt.md) and
|
77
|
+
[Brazilian](https://github.com/sinatra/sinatra/blob/main/README.pt-br.md)
|
78
78
|
Portuguese,
|
79
|
-
[French](https://github.com/sinatra/sinatra/blob/
|
80
|
-
[Spanish](https://github.com/sinatra/sinatra/blob/
|
81
|
-
[Korean](https://github.com/sinatra/sinatra/blob/
|
82
|
-
[Hungarian](https://github.com/sinatra/sinatra/blob/
|
79
|
+
[French](https://github.com/sinatra/sinatra/blob/main/README.fr.md),
|
80
|
+
[Spanish](https://github.com/sinatra/sinatra/blob/main/README.es.md),
|
81
|
+
[Korean](https://github.com/sinatra/sinatra/blob/main/README.ko.md), and
|
82
|
+
[Hungarian](https://github.com/sinatra/sinatra/blob/main/README.hu.md).
|
83
83
|
The translations tend to fall behind the English version. Translations into
|
84
84
|
other languages would also be appreciated.
|
85
85
|
|
data/Gemfile
CHANGED
@@ -15,12 +15,12 @@ gem 'rake'
|
|
15
15
|
|
16
16
|
rack_version = ENV['rack'].to_s
|
17
17
|
rack_version = nil if rack_version.empty? || (rack_version == 'stable')
|
18
|
-
rack_version = { github: 'rack/rack' } if rack_version == '
|
18
|
+
rack_version = { github: 'rack/rack' } if rack_version == 'head'
|
19
19
|
gem 'rack', rack_version
|
20
20
|
|
21
21
|
puma_version = ENV['puma'].to_s
|
22
22
|
puma_version = nil if puma_version.empty? || (puma_version == 'stable')
|
23
|
-
puma_version = { github: 'puma/puma' } if puma_version == '
|
23
|
+
puma_version = { github: 'puma/puma' } if puma_version == 'head'
|
24
24
|
gem 'puma', puma_version
|
25
25
|
|
26
26
|
gem 'minitest', '~> 5.0'
|
@@ -39,7 +39,7 @@ gem 'commonmarker', '~> 0.23.4', platforms: [:ruby]
|
|
39
39
|
gem 'erubi'
|
40
40
|
gem 'eventmachine'
|
41
41
|
gem 'falcon', '~> 0.40', platforms: [:ruby]
|
42
|
-
gem 'haml', '~>
|
42
|
+
gem 'haml', '~> 6'
|
43
43
|
gem 'kramdown'
|
44
44
|
gem 'liquid'
|
45
45
|
gem 'markaby'
|
data/MAINTENANCE.md
CHANGED
@@ -4,13 +4,13 @@
|
|
4
4
|
|
5
5
|
### Releases
|
6
6
|
|
7
|
-
The next major version of Sinatra will be released from the
|
7
|
+
The next major version of Sinatra will be released from the main branch. Each version will be tagged so it will be possible to branch of should there be a need for bug fixes and other updates.
|
8
8
|
|
9
9
|
## Issues
|
10
10
|
|
11
11
|
### New features
|
12
12
|
|
13
|
-
New features will only be added to the
|
13
|
+
New features will only be added to the main branch and will not be made available in point releases.
|
14
14
|
|
15
15
|
### Bug fixes
|
16
16
|
|
data/README.md
CHANGED
@@ -984,7 +984,7 @@ To associate a file extension with a template engine, use
|
|
984
984
|
`tt` for Haml templates, you can do the following:
|
985
985
|
|
986
986
|
```ruby
|
987
|
-
Tilt.register
|
987
|
+
Tilt.register Tilt[:haml], :tt
|
988
988
|
```
|
989
989
|
|
990
990
|
### Adding Your Own Template Engine
|
@@ -992,7 +992,7 @@ Tilt.register :tt, Tilt[:haml]
|
|
992
992
|
First, register your engine with Tilt, then create a rendering method:
|
993
993
|
|
994
994
|
```ruby
|
995
|
-
Tilt.register :myat
|
995
|
+
Tilt.register MyAwesomeTemplateEngine, :myat
|
996
996
|
|
997
997
|
helpers do
|
998
998
|
def myat(*args) render(:myat, *args) end
|
@@ -1933,7 +1933,7 @@ end
|
|
1933
1933
|
### Configuring attack protection
|
1934
1934
|
|
1935
1935
|
Sinatra is using
|
1936
|
-
[Rack::Protection](https://github.com/sinatra/sinatra/tree/
|
1936
|
+
[Rack::Protection](https://github.com/sinatra/sinatra/tree/main/rack-protection#readme) to
|
1937
1937
|
defend your application against common, opportunistic attacks. You can
|
1938
1938
|
easily disable this behavior (which will open up your application to tons
|
1939
1939
|
of common vulnerabilities):
|
@@ -2319,7 +2319,7 @@ end
|
|
2319
2319
|
```
|
2320
2320
|
|
2321
2321
|
The semantics of `use` are identical to those defined for the
|
2322
|
-
[Rack::Builder](
|
2322
|
+
[Rack::Builder](https://www.rubydoc.info/github/rack/rack/main/Rack/Builder) DSL
|
2323
2323
|
(most frequently used from rackup files). For example, the `use` method
|
2324
2324
|
accepts multiple/variable args as well as blocks:
|
2325
2325
|
|
@@ -2335,7 +2335,7 @@ many of these components automatically based on configuration so you
|
|
2335
2335
|
typically don't have to `use` them explicitly.
|
2336
2336
|
|
2337
2337
|
You can find useful middleware in
|
2338
|
-
[rack](https://github.com/rack/rack/tree/
|
2338
|
+
[rack](https://github.com/rack/rack/tree/main/lib/rack),
|
2339
2339
|
[rack-contrib](https://github.com/rack/rack-contrib#readme),
|
2340
2340
|
or in the [Rack wiki](https://github.com/rack/rack/wiki/List-of-Middleware).
|
2341
2341
|
|
@@ -2343,7 +2343,7 @@ or in the [Rack wiki](https://github.com/rack/rack/wiki/List-of-Middleware).
|
|
2343
2343
|
|
2344
2344
|
Sinatra tests can be written using any Rack-based testing library or
|
2345
2345
|
framework.
|
2346
|
-
[Rack::Test](
|
2346
|
+
[Rack::Test](https://www.rubydoc.info/github/rack/rack-test/main/frames)
|
2347
2347
|
is recommended:
|
2348
2348
|
|
2349
2349
|
```ruby
|
@@ -2838,7 +2838,7 @@ Running Sinatra on a not officially supported Ruby flavor means that if things o
|
|
2838
2838
|
## The Bleeding Edge
|
2839
2839
|
|
2840
2840
|
If you would like to use Sinatra's latest bleeding-edge code, feel free
|
2841
|
-
to run your application against the
|
2841
|
+
to run your application against the main branch, it should be rather
|
2842
2842
|
stable.
|
2843
2843
|
|
2844
2844
|
We also push out prerelease gems from time to time, so you can do a
|
@@ -2887,20 +2887,19 @@ SemVerTag.
|
|
2887
2887
|
|
2888
2888
|
## Further Reading
|
2889
2889
|
|
2890
|
-
* [Project Website](
|
2890
|
+
* [Project Website](https://sinatrarb.com/) - Additional documentation,
|
2891
2891
|
news, and links to other resources.
|
2892
|
-
* [Contributing](
|
2892
|
+
* [Contributing](https://sinatrarb.com/contributing) - Find a bug? Need
|
2893
2893
|
help? Have a patch?
|
2894
2894
|
* [Issue tracker](https://github.com/sinatra/sinatra/issues)
|
2895
2895
|
* [Twitter](https://twitter.com/sinatra)
|
2896
2896
|
* [Mailing List](https://groups.google.com/forum/#!forum/sinatrarb)
|
2897
2897
|
* IRC: [#sinatra](irc://chat.freenode.net/#sinatra) on [Freenode](https://freenode.net)
|
2898
|
-
* [Sinatra & Friends](https://
|
2899
|
-
([get an invite](https://sinatra-slack.herokuapp.com/))
|
2898
|
+
* [Sinatra & Friends](https://discord.gg/ncjsfsNHh7) on Discord
|
2900
2899
|
* [Sinatra Book](https://github.com/sinatra/sinatra-book) - Cookbook Tutorial
|
2901
2900
|
* [Sinatra Recipes](http://recipes.sinatrarb.com/) - Community contributed
|
2902
2901
|
recipes
|
2903
|
-
* API documentation for the [latest release](
|
2904
|
-
or the [current HEAD](
|
2905
|
-
[RubyDoc](
|
2902
|
+
* API documentation for the [latest release](https://www.rubydoc.info/gems/sinatra)
|
2903
|
+
or the [current HEAD](https://www.rubydoc.info/github/sinatra/sinatra) on
|
2904
|
+
[RubyDoc](https://www.rubydoc.info/)
|
2906
2905
|
* [CI Actions](https://github.com/sinatra/sinatra/actions)
|
data/Rakefile
CHANGED
@@ -1,14 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'rake/clean'
|
4
|
-
require '
|
4
|
+
require 'minitest/test_task'
|
5
5
|
require 'fileutils'
|
6
6
|
require 'date'
|
7
7
|
|
8
8
|
task default: :test
|
9
|
-
task spec: :test
|
10
|
-
|
11
|
-
CLEAN.include '**/*.rbc'
|
12
9
|
|
13
10
|
def source_version
|
14
11
|
@source_version ||= File.read(File.expand_path('VERSION', __dir__)).strip
|
@@ -24,27 +21,20 @@ def prev_version
|
|
24
21
|
source_version.gsub(/\d+$/) { |s| s.to_i - 1 }
|
25
22
|
end
|
26
23
|
|
27
|
-
#
|
24
|
+
# Tests ===============================================================
|
28
25
|
|
29
|
-
|
30
|
-
|
31
|
-
t.ruby_opts = ['-r rubygems'] if defined? Gem
|
26
|
+
Minitest::TestTask.create # Default `test` task
|
27
|
+
Minitest::TestTask.create(:'test:core') do |t|
|
32
28
|
t.warning = true
|
33
|
-
|
34
|
-
|
35
|
-
Rake::TestTask.new(:'test:core') do |t|
|
36
|
-
core_tests = %w[
|
29
|
+
t.test_globs = %w[
|
37
30
|
base delegator encoding extensions filter
|
38
31
|
helpers mapped_error middleware rdoc
|
39
32
|
readme request response result route_added_hook
|
40
33
|
routing server settings sinatra static templates
|
41
|
-
]
|
42
|
-
t.test_files = core_tests.map { |n| "test/#{n}_test.rb" }
|
43
|
-
t.ruby_opts = ['-r rubygems'] if defined? Gem
|
44
|
-
t.warning = true
|
34
|
+
].map { |n| "test/#{n}_test.rb" }
|
45
35
|
end
|
46
36
|
|
47
|
-
#
|
37
|
+
# Test code coverage ==================================================
|
48
38
|
|
49
39
|
namespace :test do
|
50
40
|
desc 'Measures test coverage'
|
@@ -54,6 +44,7 @@ namespace :test do
|
|
54
44
|
Rake::Task['test'].invoke
|
55
45
|
end
|
56
46
|
end
|
47
|
+
CLEAN.include('coverage')
|
57
48
|
|
58
49
|
# Website =============================================================
|
59
50
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.0.
|
1
|
+
3.0.6
|
data/examples/chat.rb
CHANGED
@@ -1,11 +1,13 @@
|
|
1
1
|
#!/usr/bin/env ruby -I ../lib -I lib
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
|
-
|
4
|
+
# This example does *not* work properly with WEBrick or other
|
5
|
+
# servers that buffer output. To shut down the server, close any
|
6
|
+
# open browser tabs that are connected to the chat server.
|
5
7
|
|
6
8
|
require 'sinatra'
|
7
|
-
set :server, :
|
8
|
-
connections =
|
9
|
+
set :server, :puma
|
10
|
+
connections = Set.new
|
9
11
|
|
10
12
|
get '/' do
|
11
13
|
halt erb(:login) unless params[:user]
|
@@ -14,13 +16,22 @@ end
|
|
14
16
|
|
15
17
|
get '/stream', provides: 'text/event-stream' do
|
16
18
|
stream :keep_open do |out|
|
17
|
-
connections
|
18
|
-
|
19
|
+
if connections.add?(out)
|
20
|
+
out.callback { connections.delete(out) }
|
21
|
+
end
|
22
|
+
out << "heartbeat:\n"
|
23
|
+
sleep 1
|
24
|
+
rescue
|
25
|
+
out.close
|
19
26
|
end
|
20
27
|
end
|
21
28
|
|
22
29
|
post '/' do
|
23
|
-
connections.each
|
30
|
+
connections.each do |out|
|
31
|
+
out << "data: #{params[:msg]}\n\n"
|
32
|
+
rescue
|
33
|
+
out.close
|
34
|
+
end
|
24
35
|
204 # response without entity body
|
25
36
|
end
|
26
37
|
|
@@ -37,10 +48,10 @@ __END__
|
|
37
48
|
</html>
|
38
49
|
|
39
50
|
@@ login
|
40
|
-
<form action=
|
51
|
+
<form action="/">
|
41
52
|
<label for='user'>User Name:</label>
|
42
|
-
<input name=
|
43
|
-
<input type=
|
53
|
+
<input name="user" value="" />
|
54
|
+
<input type="submit" value="GO!" />
|
44
55
|
</form>
|
45
56
|
|
46
57
|
@@ chat
|
data/lib/sinatra/base.rb
CHANGED
@@ -19,7 +19,7 @@ require 'sinatra/version'
|
|
19
19
|
|
20
20
|
module Sinatra
|
21
21
|
# The request object. See Rack::Request for more info:
|
22
|
-
#
|
22
|
+
# https://rubydoc.info/github/rack/rack/main/Rack/Request
|
23
23
|
class Request < Rack::Request
|
24
24
|
HEADER_PARAM = /\s*[\w.]+=(?:[\w.]+|"(?:[^"\\]|\\.)*")?\s*/.freeze
|
25
25
|
HEADER_VALUE_WITH_PARAMS = %r{(?:(?:\w+|\*)/(?:\w+(?:\.|-|\+)?|\*)*)\s*(?:;#{HEADER_PARAM})*}.freeze
|
@@ -158,8 +158,8 @@ module Sinatra
|
|
158
158
|
|
159
159
|
# The response object. See Rack::Response and Rack::Response::Helpers for
|
160
160
|
# more info:
|
161
|
-
#
|
162
|
-
#
|
161
|
+
# https://rubydoc.info/github/rack/rack/main/Rack/Response
|
162
|
+
# https://rubydoc.info/github/rack/rack/main/Rack/Response/Helpers
|
163
163
|
class Response < Rack::Response
|
164
164
|
DROP_BODY_RESPONSES = [204, 304].freeze
|
165
165
|
|
@@ -291,7 +291,7 @@ module Sinatra
|
|
291
291
|
elsif value
|
292
292
|
# Rack 2.0 returns a Rack::File::Iterator here instead of
|
293
293
|
# Rack::File as it was in the previous API.
|
294
|
-
unless request.head? || value.is_a?(Rack::
|
294
|
+
unless request.head? || value.is_a?(Rack::Files::Iterator) || value.is_a?(Stream)
|
295
295
|
headers.delete 'Content-Length'
|
296
296
|
end
|
297
297
|
response.body = value
|
@@ -317,7 +317,7 @@ module Sinatra
|
|
317
317
|
# Generates the absolute URI for a given path in the app.
|
318
318
|
# Takes Rack routers and reverse proxies into account.
|
319
319
|
def uri(addr = nil, absolute = true, add_script_name = true)
|
320
|
-
return addr if addr =~ /\A[a-z][a-z0-9+.\-]*:/i
|
320
|
+
return addr if addr.to_s =~ /\A[a-z][a-z0-9+.\-]*:/i
|
321
321
|
|
322
322
|
uri = [host = String.new]
|
323
323
|
if absolute
|
@@ -429,7 +429,7 @@ module Sinatra
|
|
429
429
|
|
430
430
|
last_modified opts[:last_modified] if opts[:last_modified]
|
431
431
|
|
432
|
-
file = Rack::
|
432
|
+
file = Rack::Files.new(File.dirname(settings.app_file))
|
433
433
|
result = file.serving(request, path)
|
434
434
|
|
435
435
|
result[1].each { |k, v| headers[k] ||= v }
|
@@ -474,8 +474,9 @@ module Sinatra
|
|
474
474
|
@back.call(self)
|
475
475
|
rescue Exception => e
|
476
476
|
@scheduler.schedule { raise e }
|
477
|
+
ensure
|
478
|
+
close unless @keep_open
|
477
479
|
end
|
478
|
-
close unless @keep_open
|
479
480
|
end
|
480
481
|
end
|
481
482
|
|
@@ -506,7 +507,16 @@ module Sinatra
|
|
506
507
|
def stream(keep_open = false)
|
507
508
|
scheduler = env['async.callback'] ? EventMachine : Stream
|
508
509
|
current = @params.dup
|
509
|
-
|
510
|
+
stream = if scheduler == Stream && keep_open
|
511
|
+
Stream.new(scheduler, false) do |out|
|
512
|
+
until out.closed?
|
513
|
+
with_params(current) { yield(out) }
|
514
|
+
end
|
515
|
+
end
|
516
|
+
else
|
517
|
+
Stream.new(scheduler, keep_open) { |out| with_params(current) { yield(out) } }
|
518
|
+
end
|
519
|
+
body stream
|
510
520
|
end
|
511
521
|
|
512
522
|
# Specify response freshness policy for HTTP caches (Cache-Control header).
|
@@ -1216,11 +1226,16 @@ module Sinatra
|
|
1216
1226
|
%r{rubygems/(custom|core_ext/kernel)_require\.rb$}, # rubygems require hacks
|
1217
1227
|
/active_support/, # active_support require hacks
|
1218
1228
|
%r{bundler(/(?:runtime|inline))?\.rb}, # bundler require hacks
|
1219
|
-
/<internal
|
1229
|
+
/<internal:/, # internal in ruby >= 1.9.2
|
1230
|
+
%r{zeitwerk/kernel\.rb} # Zeitwerk kernel#require decorator
|
1220
1231
|
].freeze
|
1221
1232
|
|
1222
1233
|
attr_reader :routes, :filters, :templates, :errors
|
1223
1234
|
|
1235
|
+
def callers_to_ignore
|
1236
|
+
CALLERS_TO_IGNORE
|
1237
|
+
end
|
1238
|
+
|
1224
1239
|
# Removes all routes, filters, middleware and extension hooks from the
|
1225
1240
|
# current class (not routes/filters/... defined by its superclass).
|
1226
1241
|
def reset!
|
@@ -1787,7 +1802,7 @@ module Sinatra
|
|
1787
1802
|
def cleaned_caller(keep = 3)
|
1788
1803
|
caller(1)
|
1789
1804
|
.map! { |line| line.split(/:(?=\d|in )/, 3)[0, keep] }
|
1790
|
-
.reject { |file, *_|
|
1805
|
+
.reject { |file, *_| callers_to_ignore.any? { |pattern| file =~ pattern } }
|
1791
1806
|
end
|
1792
1807
|
end
|
1793
1808
|
|
@@ -1833,8 +1848,9 @@ module Sinatra
|
|
1833
1848
|
begin
|
1834
1849
|
require 'securerandom'
|
1835
1850
|
set :session_secret, SecureRandom.hex(64)
|
1836
|
-
rescue LoadError, NotImplementedError
|
1851
|
+
rescue LoadError, NotImplementedError, RuntimeError
|
1837
1852
|
# SecureRandom raises a NotImplementedError if no random device is available
|
1853
|
+
# RuntimeError raised due to broken openssl backend: https://bugs.ruby-lang.org/issues/19230
|
1838
1854
|
set :session_secret, format('%064x', Kernel.rand((2**256) - 1))
|
1839
1855
|
end
|
1840
1856
|
|
data/lib/sinatra/version.rb
CHANGED
data/sinatra.gemspec
CHANGED
@@ -36,7 +36,7 @@ RubyGems 2.0 or newer is required to protect against public gem pushes. You can
|
|
36
36
|
|
37
37
|
s.metadata = {
|
38
38
|
'source_code_uri' => 'https://github.com/sinatra/sinatra',
|
39
|
-
'changelog_uri' => 'https://github.com/sinatra/sinatra/blob/
|
39
|
+
'changelog_uri' => 'https://github.com/sinatra/sinatra/blob/main/CHANGELOG.md',
|
40
40
|
'homepage_uri' => 'http://sinatrarb.com/',
|
41
41
|
'bug_tracker_uri' => 'https://github.com/sinatra/sinatra/issues',
|
42
42
|
'mailing_list_uri' => 'http://groups.google.com/group/sinatrarb',
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sinatra
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Blake Mizerany
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date:
|
14
|
+
date: 2023-04-11 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: mustermann
|
@@ -53,14 +53,14 @@ dependencies:
|
|
53
53
|
requirements:
|
54
54
|
- - '='
|
55
55
|
- !ruby/object:Gem::Version
|
56
|
-
version: 3.0.
|
56
|
+
version: 3.0.6
|
57
57
|
type: :runtime
|
58
58
|
prerelease: false
|
59
59
|
version_requirements: !ruby/object:Gem::Requirement
|
60
60
|
requirements:
|
61
61
|
- - '='
|
62
62
|
- !ruby/object:Gem::Version
|
63
|
-
version: 3.0.
|
63
|
+
version: 3.0.6
|
64
64
|
- !ruby/object:Gem::Dependency
|
65
65
|
name: tilt
|
66
66
|
requirement: !ruby/object:Gem::Requirement
|
@@ -128,7 +128,7 @@ licenses:
|
|
128
128
|
- MIT
|
129
129
|
metadata:
|
130
130
|
source_code_uri: https://github.com/sinatra/sinatra
|
131
|
-
changelog_uri: https://github.com/sinatra/sinatra/blob/
|
131
|
+
changelog_uri: https://github.com/sinatra/sinatra/blob/main/CHANGELOG.md
|
132
132
|
homepage_uri: http://sinatrarb.com/
|
133
133
|
bug_tracker_uri: https://github.com/sinatra/sinatra/issues
|
134
134
|
mailing_list_uri: http://groups.google.com/group/sinatrarb
|
@@ -154,7 +154,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
154
154
|
- !ruby/object:Gem::Version
|
155
155
|
version: '0'
|
156
156
|
requirements: []
|
157
|
-
rubygems_version: 3.
|
157
|
+
rubygems_version: 3.4.10
|
158
158
|
signing_key:
|
159
159
|
specification_version: 4
|
160
160
|
summary: Classy web-development dressed in a DSL
|