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.



190
191
192
# File 'lib/spiderfw/controller/http_controller.rb', line 190

def delete
  @delete
end

#domainObject

Returns the value of attribute domain.



190
191
192
# File 'lib/spiderfw/controller/http_controller.rb', line 190

def domain
  @domain
end

#getObject

Returns the value of attribute get.



190
191
192
# File 'lib/spiderfw/controller/http_controller.rb', line 190

def get
  @get
end

#http_hostObject

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_methodObject

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

#portObject

Returns the value of attribute port.



190
191
192
# File 'lib/spiderfw/controller/http_controller.rb', line 190

def port
  @port
end

#postObject

Returns the value of attribute post.



190
191
192
# File 'lib/spiderfw/controller/http_controller.rb', line 190

def post
  @post
end

#putObject

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_controlObject



223
224
225
# File 'lib/spiderfw/controller/http_controller.rb', line 223

def cache_control
    @cache_control ||= {}
end

#client_certObject



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

Returns:

  • (Boolean)


259
260
261
# File 'lib/spiderfw/controller/http_controller.rb', line 259

def delete?
    self.http_method == :DELETE
end

#full_pathObject



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_uriObject

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

Returns:

  • (Boolean)


251
252
253
# File 'lib/spiderfw/controller/http_controller.rb', line 251

def get?
    self.http_method == :GET
end

#http_pathObject



197
198
199
# File 'lib/spiderfw/controller/http_controller.rb', line 197

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

#pathObject

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

Returns:

  • (Boolean)


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

def post?
    self.http_method == :POST
end

#put?Boolean

Returns:

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

Returns:

  • (Boolean)


231
232
233
# File 'lib/spiderfw/controller/http_controller.rb', line 231

def ssl?
    @ssl
end

#uriObject

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