From c41c29a9011949f79235aa5d6af514747285f40d Mon Sep 17 00:00:00 2001 From: Yessiest Date: Sat, 15 Apr 2023 01:52:59 +0400 Subject: [PATCH] Fixed protected requests --- hyde.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hyde.rb b/hyde.rb index 383b3b5..716f28b 100644 --- a/hyde.rb +++ b/hyde.rb @@ -58,7 +58,7 @@ module Hyde # Request object with safe path encapsulation class ProtectedRequest < Request - def self.from_request(request) + def initialize(request) @path = request.path @filepath = request.filepath @request = request.request @@ -77,8 +77,9 @@ module Hyde end def match(request) if match? request.path then + p_request = Hyde::ProtectedRequest.new(request) @lock_methods = true - self.instance_exec request, &@block if @block + self.instance_exec p_request, &@block if @block @lock_methods = false end end