Fixed protected requests
This commit is contained in:
parent
98d940073b
commit
c41c29a901
5
hyde.rb
5
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
|
||||
|
|
Loading…
Reference in New Issue