

def render(self, request):
    '\n        Send www-authenticate headers to the client\n        '

    def generateWWWAuthenticate(scheme, challenge):
        l = []
        for (k, v) in challenge.items():
            l.append(networkString(('%s=%s' % (k, quoteString(v)))))
        return b' '.join([scheme, b', '.join(l)])

    def quoteString(s):
        return ('"%s"' % (s.replace('\\', '\\\\').replace('"', '\\"'),))
    request.setResponseCode(401)
    for fact in self._credentialFactories:
        challenge = request.getChallenge(request)
        request.responseHeaders.addRawHeader(b'www-authenticate', generateWWWAuthenticate(fact.scheme, challenge))
    if (request.method == b'HEAD'):
        return b''
    return b'Unauthorized'

dataset/ETHPy150Open twisted/twisted/twisted/web/_auth/wrapper.py UnauthorizedResource.render/VarMisuse@137/186 `fact`->`request`