comparison mercurial/hgweb/hgweb_mod.py @ 48561:04688c51f81f

exchangev2: remove it As discussed on the mailing list, this is incomplete and unused with little hope of revival. Differential Revision: https://phab.mercurial-scm.org/D11954
author Rapha?l Gom?s <rgomes@octobus.net>
date Tue, 07 Dec 2021 16:44:22 +0100
parents d4ba4d51f85f
children 6000f5b25c9b
comparison
equal deleted inserted replaced
48560:d6c53b40b078 48561:04688c51f81f
364 if rctx.csp: 364 if rctx.csp:
365 # hgwebdir may have added CSP header. Since we generate our own, 365 # hgwebdir may have added CSP header. Since we generate our own,
366 # replace it. 366 # replace it.
367 res.headers[b'Content-Security-Policy'] = rctx.csp 367 res.headers[b'Content-Security-Policy'] = rctx.csp
368 368
369 # /api/* is reserved for various API implementations. Dispatch
370 # accordingly. But URL paths can conflict with subrepos and virtual
371 # repos in hgwebdir. So until we have a workaround for this, only
372 # expose the URLs if the feature is enabled.
373 apienabled = rctx.repo.ui.configbool(b'experimental', b'web.apiserver')
374 if apienabled and req.dispatchparts and req.dispatchparts[0] == b'api':
375 wireprotoserver.handlewsgiapirequest(
376 rctx, req, res, self.check_perm
377 )
378 return res.sendresponse()
379
380 handled = wireprotoserver.handlewsgirequest( 369 handled = wireprotoserver.handlewsgirequest(
381 rctx, req, res, self.check_perm 370 rctx, req, res, self.check_perm
382 ) 371 )
383 if handled: 372 if handled:
384 return res.sendresponse() 373 return res.sendresponse()