Brett Porter wrote:
+ It's important to understand that the above method didn't allow you to turn off the default HTTP headers; nor
+  did it allow you to specify headers on a per-method basis.

That's not quite true, since the only default headers were the caching ones, which could be disabled by setting useCache to false. Would it be better to phrase this as "under 2.1.0 and earlier"?



BTW, maybe I'm missing something, but I took a look at the sources in the beta-5 tag, and this is what I found, starting abstracthttpclientwagon.j...@400 :

protected int execute( HttpMethod httpMethod ) throws HttpException, IOException
    {
        int statusCode = SC_NULL;
        httpMethod.getParams().setSoTimeout( getTimeout() );
        setHeaders( httpMethod );
        statusCode = client.executeMethod( httpMethod );
        return statusCode;
    }

    protected void setHeaders( HttpMethod method )
    {
// TODO: merge with the other headers and have some better defaults, unify with lightweight headers
        method.addRequestHeader( "Cache-control", "no-cache" );
        method.addRequestHeader( "Cache-store", "no-store" );
        method.addRequestHeader( "Pragma", "no-cache" );
        method.addRequestHeader( "Expires", "0" );
        method.addRequestHeader( "Accept-Encoding", "gzip" );

        if ( httpHeaders != null )
        {
for ( Iterator i = httpHeaders.keySet().iterator(); i.hasNext(); )
            {
                String header = (String) i.next();
method.addRequestHeader( header, httpHeaders.getProperty( header ) );
            }
        }
    }


I think I must be missing something; how can the above code respond to a useCache == false setting? Or is the useCache configuration a post-beta-5 feature that hadn't been released yet?

-john

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org
For additional commands, e-mail: dev-h...@maven.apache.org

Reply via email to