Author: dennisl Date: Mon Nov 15 22:09:05 2010 New Revision: 1035472 URL: http://svn.apache.org/viewvc?rev=1035472&view=rev Log: [DOXIA-417] The XmlParser is blocked from W3C URLs
Modified: maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/parser/AbstractXmlParser.java Modified: maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/parser/AbstractXmlParser.java URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/parser/AbstractXmlParser.java?rev=1035472&r1=1035471&r2=1035472&view=diff ============================================================================== --- maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/parser/AbstractXmlParser.java (original) +++ maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/parser/AbstractXmlParser.java Mon Nov 15 22:09:05 2010 @@ -798,6 +798,9 @@ public abstract class AbstractXmlParser // it is an HTTP url, using HttpClient... DefaultHttpClient client = new DefaultHttpClient(); HttpGet method = new HttpGet( url.toString() ); + // Set a user-agent that doesn't contain the word "java", otherwise it will be blocked by the W3C + // The default user-agent is "Apache-HttpClient/4.0.2 (java 1.5)" + method.setHeader( "user-agent", "Apache-HttpClient/4.0.2" ); HttpRequestRetryHandler retryHandler = new DefaultHttpRequestRetryHandler( 3, false ); client.setHttpRequestRetryHandler(retryHandler);