Class: Karst::Access::ProbeApplication

Inherits:
Object
  • Object
show all
Defined in:
lib/karst/access/probe_application.rb

Overview

Builds the smallest Rack endpoint which still gives a controller request Rails' cookie and session facilities. Calling Rails.application here would recursively enter every host middleware (including the middleware which initiated the sweep). RouteSet is the stable Rails dispatch boundary: it performs recognition and controller dispatch, but has no host middleware.

Defined Under Namespace

Classes: ConstructionError

Class Method Summary collapse

Class Method Details

.for(application) ⇒ Object



41
42
43
44
45
46
47
48
49
# File 'lib/karst/access/probe_application.rb', line 41

def for(application)
  return application unless rails_application?(application)

  build(application)
rescue LoadError, StandardError => e
  raise ConstructionError,
        "Karst could not build the Rails probe endpoint; check the application's session store configuration",
        cause: e
end