Class: Feroxbuster::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/feroxbuster/response.rb

Overview

Represents response data, either parsed from .txt or .json output.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url:, original_url: nil, path: nil, wildcard: nil, status:, method:, content_length:, line_count:, word_count:, headers: nil, extension: nil) ⇒ Response

Initializes the response object.

Parameters:

  • url (String)

    The URL that was requested.

  • original_url (String) (defaults to: nil)

    The "original" URL that was requested.

  • path (String, nil) (defaults to: nil)

    The path that was requested.

  • wildcard (Boolean, nil) (defaults to: nil)
  • status (Integer)

    The HTTP response status code.

  • method (String)

    The HTTP method used for the request.

  • content_length (Integer)

    The Content-Length of the response.

  • line_count (Integer)

    The line count of the response.

  • word_count (Integer)

    The word count of the response.

  • headers (Hash{String => String}, nil) (defaults to: nil)

    the HTTP headers of the response.

  • extension (String, nil) (defaults to: nil)


92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# File 'lib/feroxbuster/response.rb', line 92

def initialize(url:            ,
               original_url:   nil,
               path:           nil,
               wildcard:       nil,
               status:         ,
               method:         ,
               content_length: ,
               line_count:     ,
               word_count:     ,
               headers:        nil,
               extension:      nil)
  @url            = url
  @original_url   = original_url
  @path           = path
  @wildcard       = wildcard
  @status         = status
  @method         = method
  @content_length = content_length
  @line_count     = line_count
  @word_count     = word_count
  @headers        = headers
  @extension      = extension
end

Instance Attribute Details

#content_lengthInteger (readonly)

The Content-Length of the response.

Returns:

  • (Integer)


38
39
40
# File 'lib/feroxbuster/response.rb', line 38

def content_length
  @content_length
end

#extensionString? (readonly)

Returns:

  • (String, nil)


56
57
58
# File 'lib/feroxbuster/response.rb', line 56

def extension
  @extension
end

#headersHash{String => String}? (readonly)

the HTTP headers of the response.

Returns:

  • (Hash{String => String}, nil)


53
54
55
# File 'lib/feroxbuster/response.rb', line 53

def headers
  @headers
end

#line_countInteger (readonly)

The line count of the response.

Returns:

  • (Integer)


43
44
45
# File 'lib/feroxbuster/response.rb', line 43

def line_count
  @line_count
end

#methodString (readonly)

The HTTP method used for the request.

Returns:

  • (String)


33
34
35
# File 'lib/feroxbuster/response.rb', line 33

def method
  @method
end

#original_urlString (readonly)

The "original" URL that was requested.

Returns:

  • (String)


15
16
17
# File 'lib/feroxbuster/response.rb', line 15

def original_url
  @original_url
end

#pathString? (readonly)

The path that was requested.

Returns:

  • (String, nil)


20
21
22
# File 'lib/feroxbuster/response.rb', line 20

def path
  @path
end

#statusInteger (readonly)

The HTTP response status code.

Returns:

  • (Integer)


28
29
30
# File 'lib/feroxbuster/response.rb', line 28

def status
  @status
end

#urlString (readonly)

The URL that was requested.

Returns:

  • (String)


10
11
12
# File 'lib/feroxbuster/response.rb', line 10

def url
  @url
end

#wildcardBoolean? (readonly)

Returns:

  • (Boolean, nil)


23
24
25
# File 'lib/feroxbuster/response.rb', line 23

def wildcard
  @wildcard
end

#word_countInteger (readonly)

The word count of the response.

Returns:

  • (Integer)


48
49
50
# File 'lib/feroxbuster/response.rb', line 48

def word_count
  @word_count
end