Ticket #5677: 5677-fix-http-auth-schema-capitalization.patch

File 5677-fix-http-auth-schema-capitalization.patch, 1.3 KB (added by myers, 5 years ago)

patch against trunk @ 34408

  • twisted/web/_auth/wrapper.py

     
    4343            l = []
    4444            for k,v in challenge.iteritems():
    4545                l.append("%s=%s" % (k, quoteString(v)))
    46             return "%s %s" % (scheme, ", ".join(l))
     46            return "%s %s" % (scheme.title(), ", ".join(l))
    4747
    4848        def quoteString(s):
    4949            return '"%s"' % (s.replace('\\', '\\\\').replace('"', '\\"'),)
  • twisted/web/test/test_httpauth.py

     
    244244        self.assertEqual(request.responseCode, 401)
    245245        self.assertEqual(
    246246            request.responseHeaders.getRawHeaders('www-authenticate'),
    247             ['basic realm="example.com"'])
     247            ['Basic realm="example.com"'])
    248248
    249249
    250250    def test_render(self):
     
    282282        request.render(resource)
    283283        self.assertEqual(
    284284            request.responseHeaders.getRawHeaders('www-authenticate'),
    285             ['basic realm="example\\\\\\"foo"'])
     285            ['Basic realm="example\\\\\\"foo"'])
    286286
    287287
    288288