tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

check-cert-request.py (436B)


      1 import os
      2 
      3 from wptserve.utils import isomorphic_decode
      4 
      5 def main(request, response):
      6    CertChainMimeType = b"application/cert-chain+cbor"
      7 
      8    if request.headers.get(b"Accept") != CertChainMimeType:
      9        return 400, [], u"Bad Request"
     10 
     11    path = os.path.join(os.path.dirname(isomorphic_decode(__file__)), u"127.0.0.1.sxg.pem.cbor")
     12    body = open(path, u"rb").read()
     13    return 200, [(b"Content-Type", CertChainMimeType)], body