Module: Spider::HTTPController::HTTPRequest
- Defined in:
- lib/spiderfw/controller/http_controller.rb
Instance Attribute Summary collapse
-
#delete ⇒ Object
Returns the value of attribute delete.
-
#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.
-
#put ⇒ Object
Returns the value of attribute put.
Instance Method Summary collapse
- #cache_control ⇒ Object
- #client_cert ⇒ Object
- #delete? ⇒ Boolean
- #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
- #put? ⇒ Boolean
- #ssl=(bool) ⇒ Object
- #ssl? ⇒ Boolean
-
#uri ⇒ Object
Returns the REQUEST_URI reversing any proxy mappings if needed.
Instance Attribute Details
#delete ⇒ Object
Returns the value of attribute delete.
190 191 192 |
# File 'lib/spiderfw/controller/http_controller.rb', line 190 def delete @delete end |
#domain ⇒ Object
Returns the value of attribute domain.
190 191 192 |
# File 'lib/spiderfw/controller/http_controller.rb', line 190 def domain @domain end |
#get ⇒ Object
Returns the value of attribute get.
190 191 192 |
# File 'lib/spiderfw/controller/http_controller.rb', line 190 def get @get end |
#http_host ⇒ Object
Returns the value of attribute http_host.
190 191 192 |
# File 'lib/spiderfw/controller/http_controller.rb', line 190 def http_host @http_host end |
#http_method ⇒ Object
Returns the value of attribute http_method.
190 191 192 |
# File 'lib/spiderfw/controller/http_controller.rb', line 190 def http_method @http_method end |
#port ⇒ Object
Returns the value of attribute port.
190 191 192 |
# File 'lib/spiderfw/controller/http_controller.rb', line 190 def port @port end |
#post ⇒ Object
Returns the value of attribute post.
190 191 192 |
# File 'lib/spiderfw/controller/http_controller.rb', line 190 def post @post end |
#put ⇒ Object
Returns the value of attribute put.
190 191 192 |
# File 'lib/spiderfw/controller/http_controller.rb', line 190 def put @put end |
Instance Method Details
#cache_control ⇒ Object
223 224 225 |
# File 'lib/spiderfw/controller/http_controller.rb', line 223 def cache_control @cache_control ||= {} end |
#client_cert ⇒ Object
216 217 218 219 220 221 |
# File 'lib/spiderfw/controller/http_controller.rb', line 216 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 |
#delete? ⇒ Boolean
259 260 261 |
# File 'lib/spiderfw/controller/http_controller.rb', line 259 def delete? self.http_method == :DELETE end |
#full_path ⇒ Object
201 202 203 204 |
# File 'lib/spiderfw/controller/http_controller.rb', line 201 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
212 213 214 |
# File 'lib/spiderfw/controller/http_controller.rb', line 212 def full_uri 'http://'+self.env['HTTP_HOST']+uri end |
#get? ⇒ Boolean
251 252 253 |
# File 'lib/spiderfw/controller/http_controller.rb', line 251 def get? self.http_method == :GET end |
#http_path ⇒ Object
197 198 199 |
# File 'lib/spiderfw/controller/http_controller.rb', line 197 def http_path 'http://'+self.env['HTTP_HOST']+path end |
#path ⇒ Object
Returns PATH_INFO reversing any proxy mappings if needed.
193 194 195 |
# File 'lib/spiderfw/controller/http_controller.rb', line 193 def path Spider::ControllerMixins::HTTPMixin.reverse_proxy_mapping(self.env['PATH_INFO']) end |
#post? ⇒ Boolean
247 248 249 |
# File 'lib/spiderfw/controller/http_controller.rb', line 247 def post? self.http_method == :POST end |
#put? ⇒ Boolean
255 256 257 |
# File 'lib/spiderfw/controller/http_controller.rb', line 255 def put? self.http_method == :PUT end |
#ssl=(bool) ⇒ Object
227 228 229 |
# File 'lib/spiderfw/controller/http_controller.rb', line 227 def ssl=(bool) @ssl = bool end |
#ssl? ⇒ Boolean
231 232 233 |
# File 'lib/spiderfw/controller/http_controller.rb', line 231 def ssl? @ssl end |
#uri ⇒ Object
Returns the REQUEST_URI reversing any proxy mappings if needed
207 208 209 |
# File 'lib/spiderfw/controller/http_controller.rb', line 207 def uri Spider::ControllerMixins::HTTPMixin.reverse_proxy_mapping(self.env['REQUEST_URI']) end |