def create_mock_request(trace):
    head, body = trace.split("\n\n", 1)
    target, headers = head.split("\n", 1)
    headers = CaseInsensitiveDict(
        x.split(": ", 1) for x in headers.splitlines())
    method, path, proto = target.split(" ")
    app = Flask(__name__)
    return app.test_request_context(path=path,
                                    method=method,
                                    data=body,
                                    headers=dict(headers))