Address first batch of Seth's review comments.

This commit is contained in:
Jakub Warmuz 2015-10-15 17:23:43 +00:00
parent 18ddcc72f6
commit e7809563b1
No known key found for this signature in database
GPG key ID: 2A7BAD3A489B52EA
2 changed files with 6 additions and 4 deletions

View file

@ -46,7 +46,8 @@ class TLSServer(socketserver.TCPServer):
class ACMEServerMixin: # pylint: disable=old-style-class
"""ACME server common settings mixin."""
server_version = "ACME standalone client"
# TODO: c.f. #858
server_version = "ACME client standalone challenge solver"
allow_reuse_address = True
def __init__(self):
@ -95,7 +96,7 @@ class SimpleHTTPServer(BaseHTTPServer.HTTPServer, ACMEServerMixin):
class SimpleHTTPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
"""SimpleHTTP challenge handler.
Adheres to the stdlib"s `socketserver.BaseRequestHandler` interface.
Adheres to the stdlib's `socketserver.BaseRequestHandler` interface.
:ivar set simple_http_resources: A set of `SimpleHTTPResource`
objects. TODO: better name?
@ -119,7 +120,7 @@ class SimpleHTTPRequestHandler(BaseHTTPServer.BaseHTTPRequestHandler):
def handle_index(self):
"""Handle index page."""
self.send_response(200)
self.send_header("Content-type", "text/html")
self.send_header("Content-Type", "text/html")
self.end_headers()
self.wfile.write(self.server.server_version.encode())

View file

@ -122,7 +122,8 @@ class SimpleHTTPServerTest(unittest.TestCase):
def test_index(self):
response = requests.get(
'http://localhost:{0}'.format(self.port), verify=False)
self.assertEqual(response.text, 'ACME standalone client')
self.assertEqual(
response.text, 'ACME client standalone challenge solver')
self.assertTrue(response.ok)
def test_404(self):