method
_basic_auth
_basic_auth(req, res, realm, req_field, res_field, err_type, block)
public
Hide source
# File lib/webrick/httpauth.rb, line 57 def _basic_auth(req, res, realm, req_field, res_field, err_type, block) # :nodoc: user = pass = nil if /^Basic\s+(.*)/ =~ req[req_field] userpass = $1 user, pass = userpass.unpack("m*")[0].split(":", 2) end if block.call(user, pass) req.user = user return end res[res_field] = "Basic realm=\"#{realm}\"" raise err_type end