sinatra 4.2.0 → 4.2.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 904d7b82f73deaf163b96f2174229e1a2650ee4e152599b8adb4523ecae6a421
4
- data.tar.gz: eeba1a0f1198f512a5bb88dc644bf0bbb0d2c1ac4717e20951d8f3a07c4c7d30
3
+ metadata.gz: 273dc42d5989e8186e18f3c93f386454a4c63ffa1e8da672e9d5f91a4e1ea1e5
4
+ data.tar.gz: 66a2357e2aab7d0acd8a780f692ce66286eb806175199fc7ccd421267b29bf4c
5
5
  SHA512:
6
- metadata.gz: 68108e3688481b30dba13bd485f393a1daa82bcfde6231b827681b59693b7d8363310653d196e43c38513ca60380d29d4f5dc1bd9cb90c838b0d36975af806a4
7
- data.tar.gz: ce6ad419d50d6b7862224e2a611a8ea83e03d8f472b89416008de130892fa744aa05a52032a96abb95a4314947cf03a4b1f6cf97aa14519c03ead32361a24512
6
+ metadata.gz: 4a30a3cb2dad00c6c54c9ecf57066f2810e9599a1c612ecea5da910913d1380ca0307e6ed4897eb3d2cedba7faff3d225bb52c6b4975d3f9d2a120fe8d08a304
7
+ data.tar.gz: 3c241fe8a0613f29af44ed93d416fdc647febf9e0b4c725c8bc15d8328f98701181f3a01d2c8dc4987aa08a44d7b7501722945c10041ea0f37b732c4d894f5ae
data/CHANGELOG.md CHANGED
@@ -1,9 +1,14 @@
1
1
  ## Unreleased
2
2
 
3
+ ## 4.2.1 / 2025-10-10
4
+
5
+ * Fix: Revert "`PATH_INFO` can never be empty" ([#2124](https://github.com/sinatra/sinatra/pull/2124))
6
+ * addresses issues with routing and 404, [more in the original pull request](https://github.com/sinatra/sinatra/issues/2113#issuecomment-3388476329)
7
+
3
8
  ## 4.2.0 / 2025-10-08
4
9
 
5
10
  * New: Add `:static_headers` setting for custom headers in static file responses ([#2089](https://github.com/sinatra/sinatra/pull/2089))
6
- * Fix: Fix regex in `etag_matches?` to prevent ReDoS ([#2121](https://github.com/sinatra/sinatra/pull/2121)))
11
+ * Fix: Fix regex in `etag_matches?` to prevent ReDoS ([#2121](https://github.com/sinatra/sinatra/pull/2121))
7
12
  * Fix: `PATH_INFO` can never be empty ([#2114](https://github.com/sinatra/sinatra/pull/2114))
8
13
  * Fix: Fix malformed Content-Type headers ([#2081](https://github.com/sinatra/sinatra/pull/2081))
9
14
  * Fix: Avoid crash for integer values in `content_type` parameters ([#2078](https://github.com/sinatra/sinatra/pull/2078))
data/VERSION CHANGED
@@ -1 +1 @@
1
- 4.2.0
1
+ 4.2.1
data/lib/sinatra/base.rb CHANGED
@@ -1099,6 +1099,7 @@ module Sinatra
1099
1099
  # Returns pass block.
1100
1100
  def process_route(pattern, conditions, block = nil, values = [])
1101
1101
  route = @request.path_info
1102
+ route = '/' if route.empty? && !settings.empty_path_info?
1102
1103
  route = route[0..-2] if !settings.strict_paths? && route != '/' && route.end_with?('/')
1103
1104
 
1104
1105
  params = pattern.params(route)
@@ -1775,6 +1776,7 @@ module Sinatra
1775
1776
  end
1776
1777
 
1777
1778
  def route(verb, path, options = {}, &block)
1779
+ enable :empty_path_info if path == '' && empty_path_info.nil?
1778
1780
  signature = compile!(verb, path, block, **options)
1779
1781
  (@routes[verb] ||= []) << signature
1780
1782
  invoke_hook(:route_added, verb, path, block)
@@ -2000,6 +2002,7 @@ module Sinatra
2000
2002
 
2001
2003
  set :absolute_redirects, true
2002
2004
  set :prefixed_redirects, false
2005
+ set :empty_path_info, nil
2003
2006
  set :strict_paths, true
2004
2007
 
2005
2008
  set :app_file, nil
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Sinatra
4
- VERSION = '4.2.0'
4
+ VERSION = '4.2.1'
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: 4.2.0
4
+ version: 4.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Blake Mizerany
@@ -66,14 +66,14 @@ dependencies:
66
66
  requirements:
67
67
  - - '='
68
68
  - !ruby/object:Gem::Version
69
- version: 4.2.0
69
+ version: 4.2.1
70
70
  type: :runtime
71
71
  prerelease: false
72
72
  version_requirements: !ruby/object:Gem::Requirement
73
73
  requirements:
74
74
  - - '='
75
75
  - !ruby/object:Gem::Version
76
- version: 4.2.0
76
+ version: 4.2.1
77
77
  - !ruby/object:Gem::Dependency
78
78
  name: rack-session
79
79
  requirement: !ruby/object:Gem::Requirement