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.
187 188 189 |
# File 'lib/spiderfw/controller/http_controller.rb', line 187 def delete @delete end |
#domain ⇒ Object
Returns the value of attribute domain.
187 188 189 |
# File 'lib/spiderfw/controller/http_controller.rb', line 187 def domain @domain end |
#get ⇒ Object
Returns the value of attribute get.
187 188 189 |
# File 'lib/spiderfw/controller/http_controller.rb', line 187 def get @get end |
#http_host ⇒ Object
Returns the value of attribute http_host.
187 188 189 |
# File 'lib/spiderfw/controller/http_controller.rb', line 187 def http_host @http_host end |
#http_method ⇒ Object
Returns the value of attribute http_method.
187 188 189 |
# File 'lib/spiderfw/controller/http_controller.rb', line 187 def http_method @http_method end |
#port ⇒ Object
Returns the value of attribute port.
187 188 189 |
# File 'lib/spiderfw/controller/http_controller.rb', line 187 def port @port end |
#post ⇒ Object
Returns the value of attribute post.
187 188 189 |
# File 'lib/spiderfw/controller/http_controller.rb', line 187 def post @post end |
#put ⇒ Object
Returns the value of attribute put.
187 188 189 |
# File 'lib/spiderfw/controller/http_controller.rb', line 187 def put @put end |
Instance Method Details
#cache_control ⇒ Object
220 221 222 |
# File 'lib/spiderfw/controller/http_controller.rb', line 220 def cache_control @cache_control ||= {} end |
#client_cert ⇒ Object
213 214 215 216 217 218 |
# File 'lib/spiderfw/controller/http_controller.rb', line 213 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
256 257 258 |
# File 'lib/spiderfw/controller/http_controller.rb', line 256 def delete? self.http_method == :DELETE end |
#full_path ⇒ Object
198 199 200 201 |
# File 'lib/spiderfw/controller/http_controller.rb', line 198 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
209 210 211 |
# File 'lib/spiderfw/controller/http_controller.rb', line 209 def full_uri 'http://'+self.env['HTTP_HOST']+uri end |
#get? ⇒ Boolean
248 249 250 |
# File 'lib/spiderfw/controller/http_controller.rb', line 248 def get? self.http_method == :GET end |
#http_path ⇒ Object
194 195 196 |
# File 'lib/spiderfw/controller/http_controller.rb', line 194 def http_path 'http://'+self.env['HTTP_HOST']+path end |
#path ⇒ Object
Returns PATH_INFO reversing any proxy mappings if needed.
190 191 192 |
# File 'lib/spiderfw/controller/http_controller.rb', line 190 def path Spider::ControllerMixins::HTTPMixin.reverse_proxy_mapping(self.env['PATH_INFO']) end |
#post? ⇒ Boolean
244 245 246 |
# File 'lib/spiderfw/controller/http_controller.rb', line 244 def post? self.http_method == :POST end |
#put? ⇒ Boolean
252 253 254 |
# File 'lib/spiderfw/controller/http_controller.rb', line 252 def put? self.http_method == :PUT end |
#ssl=(bool) ⇒ Object
224 225 226 |
# File 'lib/spiderfw/controller/http_controller.rb', line 224 def ssl=(bool) @ssl = bool end |
#ssl? ⇒ Boolean
228 229 230 |
# File 'lib/spiderfw/controller/http_controller.rb', line 228 def ssl? @ssl end |
#uri ⇒ Object
Returns the REQUEST_URI reversing any proxy mappings if needed
204 205 206 |
# File 'lib/spiderfw/controller/http_controller.rb', line 204 def uri Spider::ControllerMixins::HTTPMixin.reverse_proxy_mapping(self.env['REQUEST_URI']) end |