The title of this question may be a bit misleading. I couldn't quite think of anything better.
Here is my problem. I am developing an Apache module that needs to manipulate a bit of content in the requested HTML document (this document can be a file on the disk or may be dynamically generated by CGI or PHP) and so I am using libxml2 with it.
I developed something working, but the problem is that when the browser requests for a page, let's say
the module does it's job. But if that page has references to a javascript file, a.js, or a stylesheet file, a.css, they are not getting served.
The reason as I perceived by examining the logs is that, as the browser sends requests for a javascript file let's say
[http://localhost/a.js] //putting [] because of limit of 1 url per post.
Apache again runs my module, the module uses a HTML parser, so when the content is not HTML, it gives error and exits, the request is abandoned.
How can I make my module to work only for text/html requests ?