sinatra 3.0.2 → 3.0.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 51d1e07bf88ff5cf3837bb62442c1e72ac0fcf0a76c1704d4807490dc03d9154
4
- data.tar.gz: 7b3aa08a0f94b508478e33c3840b3100ffc74a77d9bf6a1422010c3cbfc1193d
3
+ metadata.gz: 7596f4ab9a68b8aeebf1a916c1cd752a3e7dd2714dd7fa09b8def139f5b2b8f9
4
+ data.tar.gz: 38ee8094ab7b9bf06a30c4bbefa2b915af6a8c1d1c4c2ec4b97918e07e8dce25
5
5
  SHA512:
6
- metadata.gz: 10ffb0b48fbbd7677e4b4be938db356e005096d36b993695c1a60c27600b504a4ab38e7e920465b03f72eb60ff1b860b885c621d394d3f9b0160f848fc1a68ee
7
- data.tar.gz: e1f70f1588cf5e35d806c5f6b245920e310362fefc9e5f54e99e632bb6b532c54955d8eda8675a80294a9526a648121e70f512df88c88886ecbb7ceb75eeb951
6
+ metadata.gz: 1f2f27088c9dfb616693cbac0bfc80a2c831e8c4126c3fc86d9b9888e0b5a20bab767d0120a1ef1045466e7d4228d265503b91cb23e2c4502d5dea494017cbda
7
+ data.tar.gz: 1e941fdfd3658202725a247ca4d363fb2d2026a9aa1176f61ca170620317e75dccca16b702ca377f65169a8633e43e9c724076581777e46a13e053b717b8212e
data/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  * _Your new feature here._
4
4
 
5
+ ## 3.0.4 / 2022-11-25
6
+
7
+ * Fix: Escape filename in the Content-Disposition header. [#1841](https://github.com/sinatra/sinatra/pull/1841) by Kunpei Sakai
8
+
9
+ ## 3.0.3 / 2022-11-11
10
+
11
+ * Fix: fixed ReDoS for Rack::Protection::IPSpoofing. [#1823](https://github.com/sinatra/sinatra/pull/1823) by @ooooooo-q
12
+
5
13
  ## 3.0.2 / 2022-10-01
6
14
 
7
15
  * New: Add Haml 6 support. [#1820](https://github.com/sinatra/sinatra/pull/1820) by Jordan Owens
@@ -70,6 +78,8 @@
70
78
 
71
79
  ## 2.2.0 / 2022-02-15
72
80
 
81
+ * Breaking change: Add `#select`, `#reject` and `#compact` methods to `Sinatra::IndifferentHash`. If hash keys need to be converted to symbols, call `#to_h` to get a `Hash` instance first. [#1711](https://github.com/sinatra/sinatra/pull/1711) by Olivier Bellone
82
+
73
83
  * Handle EOFError raised by Rack and return Bad Request 400 status. [#1743](https://github.com/sinatra/sinatra/pull/1743) by tamazon
74
84
 
75
85
  * Minor refactors in `base.rb`. [#1640](https://github.com/sinatra/sinatra/pull/1640) by ceclinux
@@ -100,8 +110,6 @@
100
110
 
101
111
  * Remove unnecessary `test_files` from the gemspec. [#1712](https://github.com/sinatra/sinatra/pull/1712) by Masataka Pocke Kuwabara
102
112
 
103
- * Add `#select`, `#reject` and `#compact` methods to `Sinatra::IndifferentHash`. [#1711](https://github.com/sinatra/sinatra/pull/1711) by Olivier Bellone
104
-
105
113
  * Docs: Spanish documentation: Update README.es.md with removal of Thin. [#1630](https://github.com/sinatra/sinatra/pull/1630) by Espartaco Palma
106
114
 
107
115
  * Docs: German documentation: Fixed typos in German README.md. [#1648](https://github.com/sinatra/sinatra/pull/1648) by Juri
data/Gemfile CHANGED
@@ -15,9 +15,14 @@ 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 == 'main'
18
+ rack_version = { github: 'rack/rack' } if rack_version == 'latest'
19
19
  gem 'rack', rack_version
20
20
 
21
+ puma_version = ENV['puma'].to_s
22
+ puma_version = nil if puma_version.empty? || (puma_version == 'stable')
23
+ puma_version = { github: 'puma/puma' } if puma_version == 'latest'
24
+ gem 'puma', puma_version
25
+
21
26
  gem 'minitest', '~> 5.0'
22
27
  gem 'rack-test', github: 'rack/rack-test'
23
28
  gem 'rubocop', '~> 1.32.0', require: false
@@ -40,7 +45,6 @@ gem 'liquid'
40
45
  gem 'markaby'
41
46
  gem 'nokogiri', '> 1.5.0'
42
47
  gem 'pandoc-ruby', '~> 2.0.2'
43
- gem 'puma'
44
48
  gem 'rabl'
45
49
  gem 'rainbows', platforms: [:mri] # uses #fork
46
50
  gem 'rdiscount', platforms: [:ruby]
data/README.md CHANGED
@@ -938,7 +938,7 @@ __END__
938
938
 
939
939
  @@ layout
940
940
  %html
941
- = yield
941
+ != yield
942
942
 
943
943
  @@ index
944
944
  %div.title Hello world.
@@ -2903,4 +2903,4 @@ SemVerTag.
2903
2903
  * API documentation for the [latest release](http://www.rubydoc.info/gems/sinatra)
2904
2904
  or the [current HEAD](http://www.rubydoc.info/github/sinatra/sinatra) on
2905
2905
  [RubyDoc](http://www.rubydoc.info/)
2906
- * [CI server](https://travis-ci.org/sinatra/sinatra)
2906
+ * [CI Actions](https://github.com/sinatra/sinatra/actions)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.0.2
1
+ 3.0.4
data/lib/sinatra/base.rb CHANGED
@@ -396,13 +396,20 @@ module Sinatra
396
396
  response['Content-Type'] = mime_type
397
397
  end
398
398
 
399
+ # https://html.spec.whatwg.org/#multipart-form-data
400
+ MULTIPART_FORM_DATA_REPLACEMENT_TABLE = {
401
+ '"' => '%22',
402
+ "\r" => '%0D',
403
+ "\n" => '%0A'
404
+ }.freeze
405
+
399
406
  # Set the Content-Disposition to "attachment" with the specified filename,
400
407
  # instructing the user agents to prompt to save.
401
408
  def attachment(filename = nil, disposition = :attachment)
402
409
  response['Content-Disposition'] = disposition.to_s.dup
403
410
  return unless filename
404
411
 
405
- params = format('; filename="%s"', File.basename(filename))
412
+ params = format('; filename="%s"', File.basename(filename).gsub(/["\r\n]/, MULTIPART_FORM_DATA_REPLACEMENT_TABLE))
406
413
  response['Content-Disposition'] << params
407
414
  ext = File.extname(filename)
408
415
  content_type(ext) unless response['Content-Type'] || ext.empty?
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Sinatra
4
- VERSION = '3.0.1'
4
+ VERSION = '3.0.3'
5
5
  end
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.2
4
+ version: 3.0.4
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: 2022-10-01 00:00:00.000000000 Z
14
+ date: 2022-11-25 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.2
56
+ version: 3.0.4
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.2
63
+ version: 3.0.4
64
64
  - !ruby/object:Gem::Dependency
65
65
  name: tilt
66
66
  requirement: !ruby/object:Gem::Requirement