improve comment
parent
cb3b03873a
commit
e72fae8516
|
@ -298,7 +298,7 @@ class Mechanize
|
|||
|
||||
# set basic auth credentials.
|
||||
# ```
|
||||
# # make download.html whose content is http://example.com's html.
|
||||
# # set an auth credential with a specific url.
|
||||
# agent.add_auth("http://example.com", "username", "password")
|
||||
# ```
|
||||
def add_auth(uri : String, user : String, pass : String)
|
||||
|
|
|
@ -163,7 +163,7 @@ class Mechanize
|
|||
|
||||
# set basic auth credentials.
|
||||
# ```
|
||||
# # make download.html whose content is http://example.com's html.
|
||||
# # set an auth credential with a specific url.
|
||||
# agent.add_auth("http://example.com", "username", "password")
|
||||
# ```
|
||||
def add_auth(uri : String, user : String, pass : String)
|
||||
|
|
|
@ -8,6 +8,7 @@ class Mechanize
|
|||
@auth_accounts = Hash(URI, Hash(String, Array(String))).new
|
||||
end
|
||||
|
||||
# set an auth credential with a specific url.
|
||||
def add_auth(uri : String | URI, user : String, pass : String, realm : String? = nil, domain : String? = nil)
|
||||
target_uri = uri.dup
|
||||
unless uri.is_a?(URI)
|
||||
|
@ -28,7 +29,6 @@ class Mechanize
|
|||
end
|
||||
end
|
||||
|
||||
##
|
||||
# Returns true if credentials exist for the +challenges+ from the server at
|
||||
# +uri+.
|
||||
|
||||
|
|
Loading…
Reference in New Issue