Flask - Middleware and Extensions
Consider this middleware snippet in Flask:
What effect does this middleware have when a request is processed?
class ResponseModifierMiddleware:
def __init__(self, app):
self.app = app
def __call__(self, environ, start_response):
def custom_start(status, headers, exc_info=None):
headers.append(('X-Processed', 'True'))
return start_response(status, headers, exc_info)
return self.app(environ, custom_start)What effect does this middleware have when a request is processed?
