Find
C
ase-sensitive
R
egexp search
Path
Showing
00a4d527
from
2026-10-05
:
Revert "Bug
2045704
: Validate LoadInfoArgs and HTTP channel flags r=necko-reviewers,nika,valentin" for causing dt failures @browser_webconsole_network_messages_resend_request.js.
firefox-main
/
testing
/
mozbase
/
mozhttpd
/
mozhttpd
Navigation
Enable keyboard shortcuts
Name
Description
Size
Coverage
__init__.py
Mozhttpd is a simple http webserver written in python, designed expressly for use in automated testing scenarios. It is designed to both serve static content and provide simple web services. The server is based on python standard library modules such as SimpleHttpServer, urlparse, etc. The ThreadingMixIn is used to serve each request on a discrete thread. Some existing uses of mozhttpd include Peptest_, Eideticker_, and Talos_. .. _Peptest: https://github.com/mozilla/peptest/ .. _Eideticker: https://github.com/mozilla/eideticker/ .. _Talos: http://hg.mozilla.org/build/ The following simple example creates a basic HTTP server which serves content from the current directory, defines a single API endpoint `/api/resource/<resourceid>` and then serves requests indefinitely: :: import mozhttpd @mozhttpd.handlers.json_response def resource_get(request, objid): return (200, { 'id': objid, 'query': request.query }) httpd = mozhttpd.MozHttpd(port=8080, docroot='.', urlhandlers = [ { 'method': 'GET', 'path': '/api/resources/([^/]+)/?', 'function': resource_get } ]) print "Serving '%s' at %s:%s" % (httpd.docroot, httpd.host, httpd.port) httpd.start(block=True)
1723
-
handlers.py
Translates results of 'func' into a JSON response.
569
-
mozhttpd.py
Details of a request.
12013
-