--- a/mercurial/hgweb/hgweb_mod.py Tue Mar 13 10:34:36 2018 -0700
+++ b/mercurial/hgweb/hgweb_mod.py Tue Mar 13 16:53:21 2018 -0700
@@ -320,6 +320,13 @@
# replace it.
res.headers['Content-Security-Policy'] = rctx.csp
+ # /api/* is reserved for various API implementations. Dispatch
+ # accordingly.
+ if req.dispatchparts and req.dispatchparts[0] == b'api':
+ wireprotoserver.handlewsgiapirequest(rctx, req, res,
+ self.check_perm)
+ return res.sendresponse()
+
handled = wireprotoserver.handlewsgirequest(
rctx, req, res, self.check_perm)
if handled: