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
"""
def __call__(self, environ, start_response):
environ["request_id"] = uuid.uuid1().hex
return self.app(environ, start_response)