changeset 50896:b2b8c25f9462

hgwebmod: use sysstr to check for attribute presence We do not need bytes here.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 30 Aug 2023 13:28:09 +0200
parents a834ec41f17c
children 6ca865080479
files mercurial/hgweb/hgweb_mod.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hgweb/hgweb_mod.py	Wed Aug 30 13:07:00 2023 +0200
+++ b/mercurial/hgweb/hgweb_mod.py	Wed Aug 30 13:28:09 2023 +0200
@@ -403,7 +403,7 @@
                 cmd = cmd[style + 1 :]
 
             # avoid accepting e.g. style parameter as command
-            if util.safehasattr(webcommands, cmd):
+            if util.safehasattr(webcommands, pycompat.sysstr(cmd)):
                 req.qsparams[b'cmd'] = cmd
 
             if cmd == b'static':
@@ -474,7 +474,7 @@
                 # override easily enough.
                 res.status = b'200 Script output follows'
                 res.headers[b'Content-Type'] = ctype
-                return getattr(webcommands, cmd)(rctx)
+                return getattr(webcommands, pycompat.sysstr(cmd))(rctx)
 
         except (error.LookupError, error.RepoLookupError) as err:
             msg = pycompat.bytestr(err)