()
| 189 | |
| 190 | function sendBasicAuth(request, response) { |
| 191 | const denyAccess = function () { |
| 192 | response.writeHead(401, { 'WWW-Authenticate': 'Basic realm="test"' }) |
| 193 | response.end('Access denied') |
| 194 | } |
| 195 | |
| 196 | const basicAuthRegExp = /^\s*basic\s+([a-z0-9\-._~+/]+)=*\s*$/i |
| 197 | const auth = request.headers.authorization |