How to change the request headers in the Preprocessor class

Hello,

Could it be possible to allow the user to change the request headers in 
the Preprocessor class ?

Now there is a method:

void preprocess() throws TestException {
    final URI baseUri = results.getURI();
    try {
        final HTTPXHTMLResource resource = new HTTPXHTMLResource(baseUri);
    ...
}

And it would be great to add the following one (or to add the 
additionalRequestHeaders to the constructor) :

void preprocess(final Map<String, String> additionalRequestHeaders) 
throws TestException {
    final URI baseUri = results.getURI();
    try {
        final HTTPXHTMLResource resource = new 
HTTPXHTMLResource(baseUri, additionalRequestHeaders);
    ...
}

I am working on a crawler based on mobileok, and that might help us a 
lot to change some headers (User-Agent, Accept-Language ...).  It could 
be useful in other use cases, too.

By the way, is there any reason to make this Preprocessor class final ?
Thank you,
Guido García Bernardo

Received on Monday, 8 October 2007 12:19:23 UTC