Module: Spider::HTTPController::HTTPRequest

Defined in:
lib/spiderfw/controller/http_controller.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#domainObject

Returns the value of attribute domain.



161
162
163
# File 'lib/spiderfw/controller/http_controller.rb', line 161

def domain
  @domain
end

#getObject

Returns the value of attribute get.



161
162
163
# File 'lib/spiderfw/controller/http_controller.rb', line 161

def get
  @get
end

#http_hostObject

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_methodObject

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

#portObject

Returns the value of attribute port.



161
162
163
# File 'lib/spiderfw/controller/http_controller.rb', line 161

def port
  @port
end

#postObject

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_controlObject



194
195
196
# File 'lib/spiderfw/controller/http_controller.rb', line 194

def cache_control
    @cache_control ||= {}
end

#client_certObject



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_pathObject



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_uriObject

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

Returns:

  • (Boolean)


218
219
220
# File 'lib/spiderfw/controller/http_controller.rb', line 218

def get?
    self.http_method == :GET
end

#http_pathObject



168
169
170
# File 'lib/spiderfw/controller/http_controller.rb', line 168

def http_path
    'http://'+self.env['HTTP_HOST']+path
end

#pathObject

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

Returns:

  • (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

Returns:

  • (Boolean)


202
203
204
# File 'lib/spiderfw/controller/http_controller.rb', line 202

def ssl?
    @ssl
end

#uriObject

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