Module: Spider::HTTPController::HTTPRequest

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#deleteObject

Returns the value of attribute delete.



187
188
189
# File 'lib/spiderfw/controller/http_controller.rb', line 187

def delete
  @delete
end

#domainObject

Returns the value of attribute domain.



187
188
189
# File 'lib/spiderfw/controller/http_controller.rb', line 187

def domain
  @domain
end

#getObject

Returns the value of attribute get.



187
188
189
# File 'lib/spiderfw/controller/http_controller.rb', line 187

def get
  @get
end

#http_hostObject

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_methodObject

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

#portObject

Returns the value of attribute port.



187
188
189
# File 'lib/spiderfw/controller/http_controller.rb', line 187

def port
  @port
end

#postObject

Returns the value of attribute post.



187
188
189
# File 'lib/spiderfw/controller/http_controller.rb', line 187

def post
  @post
end

#putObject

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_controlObject



220
221
222
# File 'lib/spiderfw/controller/http_controller.rb', line 220

def cache_control
    @cache_control ||= {}
end

#client_certObject



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

Returns:

  • (Boolean)


256
257
258
# File 'lib/spiderfw/controller/http_controller.rb', line 256

def delete?
    self.http_method == :DELETE
end

#full_pathObject



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_uriObject

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

Returns:

  • (Boolean)


248
249
250
# File 'lib/spiderfw/controller/http_controller.rb', line 248

def get?
    self.http_method == :GET
end

#http_pathObject



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

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

#pathObject

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

Returns:

  • (Boolean)


244
245
246
# File 'lib/spiderfw/controller/http_controller.rb', line 244

def post?
    self.http_method == :POST
end

#put?Boolean

Returns:

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

Returns:

  • (Boolean)


228
229
230
# File 'lib/spiderfw/controller/http_controller.rb', line 228

def ssl?
    @ssl
end

#uriObject

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