diff --git a/CHANGELOG b/CHANGELOG index f319bce2..429d910d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,4 @@ -= master += 3.86.0 (2024-11-12) * Add conditional_sessions plugin, for using the sessions plugin for only a subset of requests (jeremyevans) diff --git a/doc/release_notes/3.86.0.txt b/doc/release_notes/3.86.0.txt new file mode 100644 index 00000000..8153b0d6 --- /dev/null +++ b/doc/release_notes/3.86.0.txt @@ -0,0 +1,38 @@ += New Features + +* A conditional_sessions plugin has been added. This allows you to + only support sessions for a subset of the application's requests. + You pass a block when loading the plugin, and sessions are only + supported if the block returns truthy. The block is evaluated + in request scope. + + As an example, if you do not want to support sessions for request + paths starting with /static, you could use: + + plugin :conditional_sessions, secret: ENV["SECRET"] do + !path_info.start_with?('/static') + end + + With this example, if the request path starts with /static: + + * The request methods +session+, +session_created_at+, and + +session_updated_at+ all raise an exception. + * The request +persist_session+ and route scope +clear_session+ + methods do nothing and return nil. + + Options passed when loading the plugin are passed to the sessions + plugin. + +* In the content_security_policy plugin, you can now call + response.skip_content_security_policy! to skip the setting of the + response header. + +* In the permissions_policy plugin, you can now call + response.skip_permissions_policy! to skip the setting of the + response header. + += Other Improvements + +* When using the autoload_hash_branches and/or autoload_named_routes + plugins, Roda.freeze now works correctly if the Roda class is + already frozen. diff --git a/lib/roda/version.rb b/lib/roda/version.rb index a44c911c..386947a2 100644 --- a/lib/roda/version.rb +++ b/lib/roda/version.rb @@ -4,7 +4,7 @@ class Roda RodaMajorVersion = 3 # The minor version of Roda, updated for new feature releases of Roda. - RodaMinorVersion = 85 + RodaMinorVersion = 86 # The patch version of Roda, updated only for bug fixes from the last # feature release.