sinatra 2.2.1 → 2.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b558760739957a96ebc9812bdf5a36469b20330eb41a32d5f7a1cff7f43727f0
4
- data.tar.gz: 6ff96c0afd9440ec374e7580a7bf1e9e19e27e162a83142c5ca81f729bf89286
3
+ metadata.gz: 80e0d4f746b7bf91aecaa4af649cb63f04212975287e6ef37288a9e71e73a4ec
4
+ data.tar.gz: 5fcda18c311ca7ba08a2cbdf9ed60f97ed564bc9d54af4b600a86c2c6103ddc3
5
5
  SHA512:
6
- metadata.gz: db3406d64e51dd56e2d151d777706c73a69cb7955b8f8c294f93e9ca79f463aff10750dfb9459c99568ec82f42b92ed7c2fd93af9620bcd125c5704b423a36bc
7
- data.tar.gz: 2b674e8bd98ba3fbc83eaacf6cfe76a807608a1c7c3d6d5e0b9f43c4edf885e2617ff6aa140b1e01ee0dc981162f0785e580a5bfdf930ae0993afa31ba286852
6
+ metadata.gz: 82d744ca87a984b3e96175269d1225184f885f8ae052c1089cc2973fb740376ca354579fd1c463ad4accb38e9c27bc200d0344290258ecdeb7d347b81a3ab7f6
7
+ data.tar.gz: 8242b52ec226acf2c29fc902b9d5855c7090f60191c874b1fbaf68ead68b15ad47257a0bfdfd2648173f8545158b2cab7fe262ff74a2d3e0d9a692b84dfd8c32
data/CHANGELOG.md CHANGED
@@ -1,4 +1,12 @@
1
- ## 2.2.1 / Unreleased
1
+ ## 2.2.3 / 2022-11-25
2
+
3
+ * Fix: Escape filename in the Content-Disposition header. [#1841](https://github.com/sinatra/sinatra/pull/1841) by Kunpei Sakai
4
+
5
+ ## 2.2.2 / 2022-07-23
6
+
7
+ * Update mustermann dependency to version 2.
8
+
9
+ ## 2.2.1 / 2022-07-15
2
10
 
3
11
  * Fix JRuby regression by using ruby2_keywords for delegation. [#1750](https://github.com/sinatra/sinatra/pull/1750) by Patrik Ragnarsson
4
12
 
@@ -6,6 +14,8 @@
6
14
 
7
15
  ## 2.2.0 / 2022-02-15
8
16
 
17
+ * 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 by Olivier Bellone
18
+
9
19
  * Handle EOFError raised by Rack and return Bad Request 400 status. [#1743](https://github.com/sinatra/sinatra/pull/1743) by tamazon
10
20
 
11
21
  * Update README.es.md with removal of Thin. [#1630](https://github.com/sinatra/sinatra/pull/1630) by Espartaco Palma
@@ -48,9 +58,6 @@
48
58
 
49
59
  * Remove unnecessary `test_files` from the gemspec. [#1712](https://github.com/sinatra/sinatra/pull/1712) by Masataka Pocke Kuwabara
50
60
 
51
- * Add `#select`, `#reject` and `#compact` methods to `Sinatra::IndifferentHash`. [#1711](https://github.com/sinatra/sinatra/pull/1711) by Olivier Bellone
52
-
53
-
54
61
  ### CI
55
62
 
56
63
  * Use latest JRuby 9.2.16.0 on CI. [#1682](https://github.com/sinatra/sinatra/pull/1682) by Olle Jonsson
data/Gemfile CHANGED
@@ -23,7 +23,7 @@ gem "twitter-text", "1.14.7"
23
23
 
24
24
  if RUBY_ENGINE == 'jruby'
25
25
  gem 'nokogiri', '!= 1.5.0'
26
- gem 'puma'
26
+ gem 'puma', '~> 5'
27
27
  end
28
28
 
29
29
  if RUBY_ENGINE == 'jruby' || RUBY_ENGINE == 'ruby'
@@ -38,14 +38,13 @@ if RUBY_ENGINE == "ruby"
38
38
  gem 'bluecloth'
39
39
  gem 'rdiscount'
40
40
  gem 'RedCloth'
41
- gem 'puma'
41
+ gem 'puma', '~> 5'
42
42
  gem 'yajl-ruby'
43
43
  gem 'nokogiri'
44
44
  gem 'rainbows'
45
45
  gem 'eventmachine'
46
46
  gem 'slim', '~> 2.0'
47
47
  gem 'coffee-script', '>= 2.0'
48
- gem 'rdoc'
49
48
  gem 'kramdown'
50
49
  gem 'maruku'
51
50
  gem 'creole'
data/Rakefile CHANGED
@@ -212,7 +212,7 @@ if defined?(Gem)
212
212
  end
213
213
 
214
214
  sh <<-SH
215
- #git commit --allow-empty -a -m '#{source_version} release' &&
215
+ git commit --allow-empty -a -m '#{source_version} release' &&
216
216
  git tag -s v#{source_version} -m '#{source_version} release' &&
217
217
  git push && (git push origin || true) &&
218
218
  git push --tags && (git push origin --tags || true)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.2.1
1
+ 2.2.3
data/lib/sinatra/base.rb CHANGED
@@ -381,16 +381,23 @@ module Sinatra
381
381
  response['Content-Type'] = mime_type
382
382
  end
383
383
 
384
+ # https://html.spec.whatwg.org/#multipart-form-data
385
+ MULTIPART_FORM_DATA_REPLACEMENT_TABLE = {
386
+ '"' => '%22',
387
+ "\r" => '%0D',
388
+ "\n" => '%0A'
389
+ }.freeze
390
+
384
391
  # Set the Content-Disposition to "attachment" with the specified filename,
385
392
  # instructing the user agents to prompt to save.
386
393
  def attachment(filename = nil, disposition = :attachment)
387
394
  response['Content-Disposition'] = disposition.to_s.dup
388
- if filename
389
- params = '; filename="%s"' % File.basename(filename)
390
- response['Content-Disposition'] << params
391
- ext = File.extname(filename)
392
- content_type(ext) unless response['Content-Type'] or ext.empty?
393
- end
395
+ return unless filename
396
+
397
+ params = format('; filename="%s"', File.basename(filename).gsub(/["\r\n]/, MULTIPART_FORM_DATA_REPLACEMENT_TABLE))
398
+ response['Content-Disposition'] << params
399
+ ext = File.extname(filename)
400
+ content_type(ext) unless response['Content-Type'] || ext.empty?
394
401
  end
395
402
 
396
403
  # Use the contents of the file at +path+ as the response body.
@@ -1,3 +1,3 @@
1
1
  module Sinatra
2
- VERSION = '2.2.1'
2
+ VERSION = '2.2.2'
3
3
  end
data/sinatra.gemspec CHANGED
@@ -45,5 +45,5 @@ EOF
45
45
  s.add_dependency 'rack', '~> 2.2'
46
46
  s.add_dependency 'tilt', '~> 2.0'
47
47
  s.add_dependency 'rack-protection', version
48
- s.add_dependency 'mustermann', '~> 1.0'
48
+ s.add_dependency 'mustermann', '~> 2.0'
49
49
  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: 2.2.1
4
+ version: 2.2.3
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-07-15 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: rack
@@ -47,28 +47,28 @@ dependencies:
47
47
  requirements:
48
48
  - - '='
49
49
  - !ruby/object:Gem::Version
50
- version: 2.2.1
50
+ version: 2.2.3
51
51
  type: :runtime
52
52
  prerelease: false
53
53
  version_requirements: !ruby/object:Gem::Requirement
54
54
  requirements:
55
55
  - - '='
56
56
  - !ruby/object:Gem::Version
57
- version: 2.2.1
57
+ version: 2.2.3
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: mustermann
60
60
  requirement: !ruby/object:Gem::Requirement
61
61
  requirements:
62
62
  - - "~>"
63
63
  - !ruby/object:Gem::Version
64
- version: '1.0'
64
+ version: '2.0'
65
65
  type: :runtime
66
66
  prerelease: false
67
67
  version_requirements: !ruby/object:Gem::Requirement
68
68
  requirements:
69
69
  - - "~>"
70
70
  - !ruby/object:Gem::Version
71
- version: '1.0'
71
+ version: '2.0'
72
72
  description: Sinatra is a DSL for quickly creating web applications in Ruby with minimal
73
73
  effort.
74
74
  email: sinatrarb@googlegroups.com
@@ -145,7 +145,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
145
145
  - !ruby/object:Gem::Version
146
146
  version: '0'
147
147
  requirements: []
148
- rubygems_version: 3.0.3.1
148
+ rubyforge_project:
149
+ rubygems_version: 2.7.6.3
149
150
  signing_key:
150
151
  specification_version: 4
151
152
  summary: Classy web-development dressed in a DSL