In the CssResponseWriter rewriting path, a stub gadget is created to assist with the rewriting of the URLs in the CSS file. The stub gadget's URI, rather than referring to an actual gadget URI, ends up referring to the resource that was being loaded, such that the rewritten urls include as a parameter a gadget url that is some random resource. The junit test cases seem to accept this behavior but it doesn't seem to make sense to pass an arbitrary URI as the gadget parameter. Is this intended behavior, or a bug ?
We are looking at filtering requests within the HttpFetcher by checking requested resources against those permitted for the gadget. This is based on the HttpRequest containing an 'expected' gadget URI -- not one as created above.