strong_routes 2.0.0 → 2.0.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: 110e6ed6ddef5a511bec7361e12f0264f000e995cde37c0b17e51a70c04e5801
4
- data.tar.gz: 69962aeb4a3542b4208ed44f72d4d0a002fa5af57cd03f489de056eb931e07c2
3
+ metadata.gz: 102b7a90bc7c3ab6942888539c7f4e95391c28ea1e8eec11fdffd86e24e8f0e1
4
+ data.tar.gz: 27dee942feaed1395d9f2c66cc61f7373a585acd033f5a8c621c6fa4c688f416
5
5
  SHA512:
6
- metadata.gz: 4384f2f42dc58b9ddedb75f5c287ee90880f773e0e51059e1e22dc3b3776e723d05ac3d4b03136998cb107ece9b8e8013eacb17f0bbe7c5d058f2f031fa913c1
7
- data.tar.gz: 5c4a7ff749c8e4953a825c08330f850d26bed5d0e9d2bc8017b86ecb2071c9fb7a20ebd4df5a90e07933bc06005eff719afe96741f026cc7f8cdcb1393b44a22
6
+ metadata.gz: f370a8e51e52aa750fdc1ea0cf35e4aedc7a3d15a1bb42f4d3d77a5089eff8c64b15c4c8096232207ff4e09361163d77c90f30865bc67a6d2242f936653a2852
7
+ data.tar.gz: 3685b14864e20d05d38d5ced62c97a1897ebd280090cdd864d96215b09b67360c26de5380c55e16304486db0154f6b37157188f82c58c321f01920be433e033d
data/CHANGELOG.md CHANGED
@@ -1,8 +1,32 @@
1
- ## [Unreleased]
1
+ All notable changes to this project will be documented in this file.
2
2
 
3
- - Require Ruby 2.7
3
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
4
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
5
+
6
+ ## Unreleased
7
+
8
+ ## [2.0.0] – 2024-12-21
9
+
10
+ - Modernize the gem setup [#5](https://github.com/liveh2o/strong_routes/pull/5)
11
+ - Make Allow middleware thread-safe without duping (85x faster!) [#6](https://github.com/liveh2o/strong_routes/pull/6)
12
+ - Return 404 HEAD response by default (if `public/404.html` is present in Rails apps, it is rendered instead) [#7](https://github.com/liveh2o/strong_routes/pull/7)
13
+ - Automatically reload allowed routes in Rails apps when routes change (in development mode)
4
14
  - Use Standard styles
5
15
 
16
+ ### Added
17
+
18
+ - Add config options for `:content`, `:content_type`, and `:status`. If `:content` is nil (the default), no headers will be returned. Otherwise, a `content-type` header will be added. If `:content_type` is nil (the default), `"text/plain"` will be used.
19
+
20
+ ### Changed
21
+
22
+ - Allowed routes now require a leading slash (i.e., "/") [#9](https://github.com/liveh2o/strong_routes/pull/9)
23
+
24
+ ### Removed
25
+
26
+ - Drop support for the `:message` config option (use `:content` instead)
27
+ - Drop support for allowing routes as symbols
28
+ - Require Ruby 2.7
29
+
6
30
  ## [1.0.2] - 2016-02-09
7
31
 
8
32
  - Make allow middleware thread-safe ([61a3b50](https://github.com/liveh2o/strong_routes/commit/61a3b507e83f6a582d1cee9f36b70306b0fc0eae))
@@ -9,7 +9,11 @@ module StrongRoutes
9
9
  escaped_route = Regexp.escape(route)
10
10
  # Replace dynamic segments in the route with wildcards (e.g. /:foo/users/:id becomes /.*/users/.*)
11
11
  escaped_route.gsub!(/:\w+/, ".*")
12
- super(/\A#{escaped_route}/i)
12
+
13
+ # (:?\?.*)*$ matches the end of the string OR a '?' followed by anything until the end of string
14
+ # validation of query params is left to the app, but this at least prevents a route such as "/"
15
+ # from matching "/foo" while still allowing query params
16
+ super(/\A#{escaped_route}(:?\?.*)*$/i)
13
17
  end
14
18
  end
15
19
  end
@@ -1,3 +1,3 @@
1
1
  module StrongRoutes
2
- VERSION = "2.0.0"
2
+ VERSION = "2.0.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: strong_routes
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Hutchison
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-12-21 00:00:00.000000000 Z
11
+ date: 2025-06-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
@@ -53,7 +53,7 @@ metadata:
53
53
  homepage_uri: https://github.com/liveh2o/strong_routes
54
54
  source_code_uri: https://github.com/liveh2o/strong_routes
55
55
  changelog_uri: https://github.com/liveh2o/strong_routes/blob/main/CHANGELOG.md
56
- post_install_message:
56
+ post_install_message:
57
57
  rdoc_options: []
58
58
  require_paths:
59
59
  - lib
@@ -68,8 +68,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
68
68
  - !ruby/object:Gem::Version
69
69
  version: '0'
70
70
  requirements: []
71
- rubygems_version: 3.4.22
72
- signing_key:
71
+ rubygems_version: 3.4.10
72
+ signing_key:
73
73
  specification_version: 4
74
74
  summary: Middleware to reject/allow requests before allocating a database connection
75
75
  or any resources