What is generating the content that is going into this filter?

The mod_wsgi package doesn't provide an ability to write Apache output
filters. All you could do is write a WSGI middleware for a Python WSGI
application to perform fixups on any response content. Such a method
will only work for Python WSGI applications and it cannot be used
where the request content is coming from static files or other Apache
handlers which are generating dynamic content. Even if a Python WSGI
application is generating the request content, writing WSGI middleware
to perform such fixups is not a simple exercise if want the middleware
to be compliant with the WSGI specification in all ways.

Graham

On 18 October 2012 13:04, Noorul Islam Kamal Malmiyoda
<[email protected]> wrote:
> On Wednesday, October 17, 2012 4:54:49 AM UTC+5:30, Graham Dumpleton wrote:
>>
>> Can you post the code for your fixup handler.
>>
>> A fixup handler is run before the content handler in mod_python and so
>> it can't actually be used to change the response data (content) from a
>> content handler. So what you mean by response data is confusing.
>>
>
>
> def fixuphandler(req):
>     req.register_output_filter("LOCATIONFIXUP", location_fixup)
>     req.add_output_filter("LOCATIONFIXUP")
>
> def location_fixup(filter):
>     // Code to read contents from filter and do the necessary changes.
>             temp_doc = filter.req.temp_doc
>             s = filter.read()
>             while s:
>                 temp_doc.append(s)
>                 s = filter.read()
>             if s is None:
>                 page = ''.join(temp_doc)
>
>             page = filter_html(page, filter_proxy_uri_base,
>                                    "/%s/%s" % (hum_loc, hum_key),
>                                    proxy_host, server_name, aggr_level,
>                                    tag_debug)
>              filter.write(page)
>              filter.close()
>
> filter_html is the function which processes the html content.
>
> Thanks and Regards
> Noorul
>
> --
> You received this message because you are subscribed to the Google Groups
> "modwsgi" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/modwsgi/-/YXRGRAnt-3MJ.
>
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/modwsgi?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/modwsgi?hl=en.

Reply via email to