From: Victor Stinner Date: Tue, 29 Oct 2019 05:40:15 +0000 (+0100) Subject: bpo-38243, xmlrpc.server: Escape the server_title (GH-16373) (GH-16441) (#16516) X-Git-Tag: v3.5.8~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3fe1b19265b55c290fc956e9aafcf661803782de;p=thirdparty%2FPython%2Fcpython.git bpo-38243, xmlrpc.server: Escape the server_title (GH-16373) (GH-16441) (#16516) Escape the server title of xmlrpc.server.DocXMLRPCServer when rendering the document page as HTML. (cherry picked from commit e8650a4f8c7fb76f570d4ca9c1fbe44e91c8dfaa) --- diff --git a/Lib/test/test_docxmlrpc.py b/Lib/test/test_docxmlrpc.py index 00903337c07c..d2adb21af0fb 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 from test import support threading = support.import_module('threading') @@ -193,6 +194,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