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.
161 162 163 |
# File 'lib/spiderfw/controller/http_controller.rb', line 161 def domain @domain end |
#get ⇒ Object
Returns the value of attribute get.
161 162 163 |
# File 'lib/spiderfw/controller/http_controller.rb', line 161 def get @get end |
#http_host ⇒ Object
Returns the value of attribute http_host.
161 162 163 |
# File 'lib/spiderfw/controller/http_controller.rb', line 161 def http_host @http_host end |
#http_method ⇒ Object
Returns the value of attribute http_method.
161 162 163 |
# File 'lib/spiderfw/controller/http_controller.rb', line 161 def http_method @http_method end |
#port ⇒ Object
Returns the value of attribute port.
161 162 163 |
# File 'lib/spiderfw/controller/http_controller.rb', line 161 def port @port end |
#post ⇒ Object
Returns the value of attribute post.
161 162 163 |
# File 'lib/spiderfw/controller/http_controller.rb', line 161 def post @post end |
Instance Method Details
#cache_control ⇒ Object
194 195 196 |
# File 'lib/spiderfw/controller/http_controller.rb', line 194 def cache_control @cache_control ||= {} end |
#client_cert ⇒ Object
187 188 189 190 191 192 |
# File 'lib/spiderfw/controller/http_controller.rb', line 187 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
172 173 174 175 |
# File 'lib/spiderfw/controller/http_controller.rb', line 172 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
183 184 185 |
# File 'lib/spiderfw/controller/http_controller.rb', line 183 def full_uri 'http://'+self.env['HTTP_HOST']+uri end |
#get? ⇒ Boolean
218 219 220 |
# File 'lib/spiderfw/controller/http_controller.rb', line 218 def get? self.http_method == :GET end |
#http_path ⇒ Object
168 169 170 |
# File 'lib/spiderfw/controller/http_controller.rb', line 168 def http_path 'http://'+self.env['HTTP_HOST']+path end |
#path ⇒ Object
Returns PATH_INFO reversing any proxy mappings if needed.
164 165 166 |
# File 'lib/spiderfw/controller/http_controller.rb', line 164 def path Spider::ControllerMixins::HTTPMixin.reverse_proxy_mapping(self.env['PATH_INFO']) end |
#post? ⇒ Boolean
214 215 216 |
# File 'lib/spiderfw/controller/http_controller.rb', line 214 def post? self.http_method == :POST end |
#ssl=(bool) ⇒ Object
198 199 200 |
# File 'lib/spiderfw/controller/http_controller.rb', line 198 def ssl=(bool) @ssl = bool end |
#ssl? ⇒ Boolean
202 203 204 |
# File 'lib/spiderfw/controller/http_controller.rb', line 202 def ssl? @ssl end |
#uri ⇒ Object
Returns the REQUEST_URI reversing any proxy mappings if needed
178 179 180 |
# File 'lib/spiderfw/controller/http_controller.rb', line 178 def uri Spider::ControllerMixins::HTTPMixin.reverse_proxy_mapping(self.env['REQUEST_URI']) end |