From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Fri, 27 Sep 2019 20:19:41 +0000 (-0700) Subject: bpo-38243, xmlrpc.server: Escape the server_title (GH-16373) X-Git-Tag: v3.8.0rc1~25 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6447b9f9bd27e1f6b04cef674dd3a7ab27bf4f28;p=python bpo-38243, xmlrpc.server: Escape the server_title (GH-16373) Escape the server title of xmlrpc.server.DocXMLRPCServer when rendering the document page as HTML. (cherry picked from commit e8650a4f8c7fb76f570d4ca9c1fbe44e91c8dfaa) Co-authored-by: Dong-hee Na --- diff --git a/Lib/test/test_docxmlrpc.py b/Lib/test/test_docxmlrpc.py index 116e626740..7d3e30cbee 100644 --- a/Lib/test/test_docxmlrpc.py +++ b/Lib/test/test_docxmlrpc.py @@ -1,5 +1,6 @@ from xmlrpc.server import DocXMLRPCServer import http.client +import re import sys import threading import unittest @@ -192,6 +193,21 @@ class DocXMLRPCHTTPGETServer(unittest.TestCase): b'method_annotation(x: bytes)'), response.read()) + def test_server_title_escape(self): + # bpo-38243: Ensure that the server title and documentation + # are escaped for HTML. + self.serv.set_server_title('test_title