Sha256: 2aa98840d55f40d53cc307dea5718a407e49bc50415cdecc40d2fe57e9aae64f
Contents?: true
Size: 1.44 KB
Versions: 15
Compression:
Stored size: 1.44 KB
Contents
require 'rack/request' module Jets::Controller class Request include Rack::Request::Helpers include Compat::Request include Compat::Params include ActionDispatch::Flash::RequestMethods include ActionDispatch::Http::Cache::Request include ActionDispatch::Http::MimeNegotiation include ActionDispatch::Http::FilterParameters # parameter_filter and filtered_parameters include ActionDispatch::Http::URL include ActionDispatch::RequestCookieMethods include ActionDispatch::ContentSecurityPolicy::Request include ActionDispatch::PermissionsPolicy::Request include Rack::Request::Env # since jets delegates parameter_filter from controller to request public :parameter_filter attr_reader :event, :env attr_accessor :routes def initialize(rack_env: nil, event: nil) @rack_env = rack_env @event = event @env = normalize_env super(@env) # Rack::Env module => super() end def normalize_env if @rack_env # already rack env @rack_env # rack_env is from Controller.action => lambda { |env| .. } else Jets::Controller::RackAdapter::Env.new(@event, {}).convert # convert to Rack env end end # When request hits the middleware Controller::RackAdapter::Middleware::Main endpoint # We updated env since it could had been mutated down the middleware stack # from Mimic to Main. def set_env!(env) @env = env end end end
Version data entries
15 entries across 15 versions & 1 rubygems