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 +4 -4
- data/CHANGELOG.md +26 -2
- data/lib/strong_routes/matcher.rb +5 -1
- data/lib/strong_routes/version.rb +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: 102b7a90bc7c3ab6942888539c7f4e95391c28ea1e8eec11fdffd86e24e8f0e1
|
4
|
+
data.tar.gz: 27dee942feaed1395d9f2c66cc61f7373a585acd033f5a8c621c6fa4c688f416
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f370a8e51e52aa750fdc1ea0cf35e4aedc7a3d15a1bb42f4d3d77a5089eff8c64b15c4c8096232207ff4e09361163d77c90f30865bc67a6d2242f936653a2852
|
7
|
+
data.tar.gz: 3685b14864e20d05d38d5ced62c97a1897ebd280090cdd864d96215b09b67360c26de5380c55e16304486db0154f6b37157188f82c58c321f01920be433e033d
|
data/CHANGELOG.md
CHANGED
@@ -1,8 +1,32 @@
|
|
1
|
-
|
1
|
+
All notable changes to this project will be documented in this file.
|
2
2
|
|
3
|
-
|
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
|
-
|
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
|
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.
|
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:
|
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.
|
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
|