Source code for galaxy.web.framework.middleware.request_id

import uuid


[docs]class RequestIDMiddleware: """ A WSGI middleware that creates a unique ID for the request and puts it in the environment """
[docs] def __init__(self, app, global_conf=None): self.app = app
def __call__(self, environ, start_response): environ["request_id"] = uuid.uuid1().hex return self.app(environ, start_response)