improve comment

master
Kanezoh 2022-01-15 12:32:31 +09:00
parent cb3b03873a
commit e72fae8516
3 changed files with 3 additions and 3 deletions

View File

@ -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)

View File

@ -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)

View File

@ -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+.