Class: TDiary::Request

Inherits:
Rack::Request
  • Object
show all
Includes:
RequestExtension
Defined in:
lib/tdiary/request.rb

Instance Method Summary collapse

Methods included from RequestExtension

#cgi_cookies, #cgi_params, #hide_referer!, #https?, #mobile_agent?, #param, #referer, #remote_addr, #remote_user, #smartphone?, #static_assets?, #tdiary_base_url, #valid?

Instance Method Details

#cgi_compatObject

the @cgi object handed to plugins: a facade over this request. Endpoints behind a web server (CGI/FCGI) set tdiary.static_assets in the env to get the base CGICompat. The RackCGI/CGICompat split only serves third-party plugins that check @cgi.is_a?(RackCGI); in-repo code reads the flag through RequestExtension#static_assets?.



11
12
13
14
15
16
17
18
# File 'lib/tdiary/request.rb', line 11

def cgi_compat
	@cgi_compat ||=
		if env['tdiary.static_assets']
			TDiary::CGICompat.new( self )
		else
			::RackCGI.new( self )
		end
end