Skip to content

Commit 9151c2c

Browse files
committed
Add docstrings and avoid multiple returns
1 parent 20e48a2 commit 9151c2c

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

lib/metasploit/framework/login_scanner/glassfish.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class Glassfish < HTTP
1212
DEFAULT_PORT = 4848
1313
PRIVATE_TYPES = [ :password ]
1414

15-
# @!attribute version
15+
# @!attribute [r] version
1616
# @return [String] Glassfish version
1717
attr_reader :version
1818

lib/metasploit/framework/login_scanner/http.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ class HTTP
3535
presence: true,
3636
length: { minimum: 1 }
3737

38+
# (see Base#check_setup)
3839
def check_setup
3940
http_client = Rex::Proto::Http::Client.new(
4041
host, port, {}, ssl, ssl_version
@@ -48,10 +49,10 @@ def check_setup
4849
response = http_client._send_recv(request)
4950

5051
if !(response && response.code == 401 && response.headers['WWW-Authenticate'])
51-
return "No authentication required"
52+
"No authentication required"
53+
else
54+
false
5255
end
53-
54-
false
5556
end
5657

5758
# Attempt a single login with a single credential against the target.

0 commit comments

Comments
 (0)