toolkit/components/payments/server.py
author Cosmin Sabou <csabou@mozilla.com>
Fri, 27 Apr 2018 08:37:29 +0300
changeset 472049 9424d87854e4f1783435e5a3c2e58189197d2936
parent 472015 browser/components/payments/server.py@a8fef63084795665c01e9753fb8647b71e9c0331
permissions -rw-r--r--
Backed out 2 changesets (bug 1457287) for browser chrome failures on browser_address_edit.js. CLOSED TREE Backed out changeset 0ae9810db352 (bug 1457287) Backed out changeset a8fef6308479 (bug 1457287)

import BaseHTTPServer
from SimpleHTTPServer import SimpleHTTPRequestHandler


class RequestHandler(SimpleHTTPRequestHandler, object):
    def translate_path(self, path):
        # Map autofill paths to their own directory
        autofillPath = "/formautofill"
        if (path.startswith(autofillPath)):
            path = "browser/extensions/formautofill/content" + path[len(autofillPath):]
        else:
            path = "toolkit/components/payments/res" + path

        return super(RequestHandler, self).translate_path(path)


if __name__ == '__main__':
    BaseHTTPServer.test(RequestHandler, BaseHTTPServer.HTTPServer)