[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GMG-Devel] Question about Meddleware

From: Sebastian Spaeth
Subject: [GMG-Devel] Question about Meddleware
Date: Thu, 29 Nov 2012 10:20:03 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.10) Gecko/20121027 Icedove/10.0.10

Hi all,

I am in the process of writing an HTML-tidy meddleware plugin that strips whitespace out of the HTML response (we are VERY generous with whitespace there :-)). During that process a few questions about how meddleware works popped up. So here go my question:

This is how we handle the request part:

 # pass the request through our meddleware classes
 for m in self.meddleware:
    response = m.process_request(request, controller)
    if response is not None:
        return response(environ, start_response)

So as soon as a single meddleware claims to handle the request, we stop parsing them through the others. Is this really what's intended here? AFAIK django hands requests through meddlewares, and hands the responses through all meddlewares in reverse order.

2) Our standard enabled meddlewares are "NoOp" and "CSRF". Calling a NoOp certainly doesn't hurt, but with all due respect are mediagoblins trying to accelerate climate change by burning CPU cycles? Why include the NoOp meddleware? I am sure there is a reason that I have overlooked.

Thanks for listening :-)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]