bpo-38243, xmlrpc.server: Escape the server_title (GH-16373) · python/cpython@e8650a4 · GitHub
Skip to content

Commit e8650a4

Browse files
corona10vstinner
authored andcommitted
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.
1 parent dd6117c commit e8650a4

3 files changed

Lines changed: 21 additions & 1 deletion

File tree

Lib/test/test_docxmlrpc.py

Lines changed: 16 additions & 0 deletions

Lib/xmlrpc/server.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ def export_add(self, x, y):
108108
from http.server import BaseHTTPRequestHandler
109109
from functools import partial
110110
from inspect import signature
111+
import html
111112
import http.server
112113
import socketserver
113114
import sys
@@ -894,7 +895,7 @@ def generate_html_documentation(self):
894895
methods
895896
)
896897

897-
return documenter.page(self.server_title, documentation)
898+
return documenter.page(html.escape(self.server_title), documentation)
898899

899900
class DocXMLRPCRequestHandler(SimpleXMLRPCRequestHandler):
900901
"""XML-RPC and documentation request handler class.
Lines changed: 3 additions & 0 deletions

0 commit comments

Comments
 (0)