mitmproxy/test/serv.py
Aldo Cortesi d5e3722c97 Fix an issue caused by some editors when editing a request/response body.
Many editors make it hard save a file without a terminating newline on the last
line. When editing message bodies, this can cause problems. For now, I just
strip the newlines off the end of the body when we return from an editor.
2012-01-21 12:43:00 +13:00

9 lines
227 B
Python

import socket
from SocketServer import BaseServer
from BaseHTTPServer import HTTPServer
import handler
def make(port):
server_address = ('127.0.0.1', port)
return HTTPServer(server_address, handler.TestRequestHandler)