Module: Spider::HTTPController::HTTPRequest
- Defined in:
- lib/spiderfw/controller/http_controller.rb
Instance Attribute Summary collapse
-
#domain ⇒ Object
Returns the value of attribute domain.
-
#get ⇒ Object
Returns the value of attribute get.
-
#http_host ⇒ Object
Returns the value of attribute http_host.
-
#http_method ⇒ Object
Returns the value of attribute http_method.
-
#port ⇒ Object
Returns the value of attribute port.
-
#post ⇒ Object
Returns the value of attribute post.
Instance Method Summary collapse
- #cache_control ⇒ Object
- #client_cert ⇒ Object
- #full_path ⇒ Object
-
#full_uri ⇒ Object
Returns #uri prefixed with http:// and the HTTP_HOST.
- #get? ⇒ Boolean
- #http_path ⇒ Object
-
#path ⇒ Object
Returns PATH_INFO reversing any proxy mappings if needed.
- #post? ⇒ Boolean
- #ssl=(bool) ⇒ Object
- #ssl? ⇒ Boolean
-
#uri ⇒ Object
Returns the REQUEST_URI reversing any proxy mappings if needed.
Instance Attribute Details
#domain ⇒ Object
Returns the value of attribute domain.
179 180 181 |
# File 'lib/spiderfw/controller/http_controller.rb', line 179 def domain @domain end |
#get ⇒ Object
Returns the value of attribute get.
179 180 181 |
# File 'lib/spiderfw/controller/http_controller.rb', line 179 def get @get end |
#http_host ⇒ Object
Returns the value of attribute http_host.
179 180 181 |
# File 'lib/spiderfw/controller/http_controller.rb', line 179 def http_host @http_host end |
#http_method ⇒ Object
Returns the value of attribute http_method.
179 180 181 |
# File 'lib/spiderfw/controller/http_controller.rb', line 179 def http_method @http_method end |
#port ⇒ Object
Returns the value of attribute port.
179 180 181 |
# File 'lib/spiderfw/controller/http_controller.rb', line 179 def port @port end |
#post ⇒ Object
Returns the value of attribute post.
179 180 181 |
# File 'lib/spiderfw/controller/http_controller.rb', line 179 def post @post end |
Instance Method Details
#cache_control ⇒ Object
212 213 214 |
# File 'lib/spiderfw/controller/http_controller.rb', line 212 def cache_control @cache_control ||= {} end |
#client_cert ⇒ Object
205 206 207 208 209 210 |
# File 'lib/spiderfw/controller/http_controller.rb', line 205 def client_cert return @client_certificate if @client_cert unless self.env['SSL_CLIENT_CERT'].blank? @client_cert = OpenSSL::X509::Certificate.new(self.env['SSL_CLIENT_CERT']) end end |
#full_path ⇒ Object
190 191 192 193 |
# File 'lib/spiderfw/controller/http_controller.rb', line 190 def full_path Spider.logger.warn("Request#full_path is deprecated. Use Request#http_path instead") http_path end |
#full_uri ⇒ Object
Returns #uri prefixed with http:// and the HTTP_HOST
201 202 203 |
# File 'lib/spiderfw/controller/http_controller.rb', line 201 def full_uri 'http://'+self.env['HTTP_HOST']+uri end |
#get? ⇒ Boolean
236 237 238 |
# File 'lib/spiderfw/controller/http_controller.rb', line 236 def get? self.http_method == :GET end |
#http_path ⇒ Object
186 187 188 |
# File 'lib/spiderfw/controller/http_controller.rb', line 186 def http_path 'http://'+self.env['HTTP_HOST']+path end |
#path ⇒ Object
Returns PATH_INFO reversing any proxy mappings if needed.
182 183 184 |
# File 'lib/spiderfw/controller/http_controller.rb', line 182 def path Spider::ControllerMixins::HTTPMixin.reverse_proxy_mapping(self.env['PATH_INFO']) end |
#post? ⇒ Boolean
232 233 234 |
# File 'lib/spiderfw/controller/http_controller.rb', line 232 def post? self.http_method == :POST end |
#ssl=(bool) ⇒ Object
216 217 218 |
# File 'lib/spiderfw/controller/http_controller.rb', line 216 def ssl=(bool) @ssl = bool end |
#ssl? ⇒ Boolean
220 221 222 |
# File 'lib/spiderfw/controller/http_controller.rb', line 220 def ssl? @ssl end |
#uri ⇒ Object
Returns the REQUEST_URI reversing any proxy mappings if needed
196 197 198 |
# File 'lib/spiderfw/controller/http_controller.rb', line 196 def uri Spider::ControllerMixins::HTTPMixin.reverse_proxy_mapping(self.env['REQUEST_URI']) end |