#1# Copyright (c) 2006-2025 Wade Alcorn - [email protected]2# Browser Exploitation Framework (BeEF) - https://beefproject.com3# See the file 'doc/COPYING' for copying permission4#5#6# Generic Http Handler that extensions can use to register http7# controllers into the framework.8#9module BeEF10module Extension11module AdminUI12module Handlers13class UI14#15# Constructor16#17def initialize(klass)18@klass = BeEF::Extension::AdminUI::Controllers.const_get(klass.to_s.capitalize)19end2021def call(env)22@request = Rack::Request.new(env)23@response = Rack::Response.new(env)2425controller = @klass.new26controller.run(@request, @response)2728@response = Rack::Response.new(29body = [controller.body],30status = controller.status,31header = controller.headers32)33end3435@request36@response37end38end39end40end41end424344