W3C home > Mailing lists > Public > public-mobileok-checker@w3.org > October 2007

How to change the request headers in the Preprocessor class

From: Guido García Bernardo <ggarciab@itdeusto.com>
Date: Mon, 08 Oct 2007 09:56:35 +0000
Message-ID: <4709FEE2.4030401@itdeusto.com>
To: public-mobileok-checker-request@w3.org

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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:13:04 GMT