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
|
# Request object with safe path encapsulation
|
||||||
class ProtectedRequest < Request
|
class ProtectedRequest < Request
|
||||||
def self.from_request(request)
|
def initialize(request)
|
||||||
@path = request.path
|
@path = request.path
|
||||||
@filepath = request.filepath
|
@filepath = request.filepath
|
||||||
@request = request.request
|
@request = request.request
|
||||||
|
@ -77,8 +77,9 @@ module Hyde
|
||||||
end
|
end
|
||||||
def match(request)
|
def match(request)
|
||||||
if match? request.path then
|
if match? request.path then
|
||||||
|
p_request = Hyde::ProtectedRequest.new(request)
|
||||||
@lock_methods = true
|
@lock_methods = true
|
||||||
self.instance_exec request, &@block if @block
|
self.instance_exec p_request, &@block if @block
|
||||||
@lock_methods = false
|
@lock_methods = false
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue